4

I'm trying to recover from a faulty installation, and want to remove some packages. But I can't.

# apt autoremove offending-package
dpkg: warning:  'start-stop-daemon' not found in PATH or not executable

(My PATH is fine.)

According to packages.debian.org, start-stop-daemon should be in /sbin/.

It isn't there! What should I do?

2

Another way to do this is first create a dummy /usr/local/sbin/start-stop-daemon that does nothing:

#!/bin/sh
exec true
then simply reinstall the dpkg package:

aptitude reinstall dpkg
then (of course) remove the dummy /usr/local/sbin/start-stop-daemon.

Installing the dpkg package does not in fact require start-stop-daemon at any point. It is simply the case that the dpkg command, that is run to reinstall its own package, checks that start-stop-daemon is on the command search path in case a package installation/deinstallation script happens to use it.

| improve this answer | |
4

My solution was to download the dpkg binary and install start-stop-daemon by hand.

# apt download dpkg

# sudo ar -x dpkg_version-info.deb

# tar -xzf data.tar.gz

# mv ./sbin/start-stop-daemon /sbin

Now everything works, but I'm still stumped how it went missing!

| improve this answer | |
  • @dirkt please explain the evidence that makes you guess that systemd blindly deleted files which belong to the dpkg package. – sourcejedi May 27 '18 at 11:52
  • 1
    @dirkt that’s blatant FUD. start-stop-daemon is part of dpkg, no package, systemd-related or not, could cause its removal. You can also use sysvinit on Debian 9 if you don’t like systemd, no need to switch to Devuan (but anyone wishing to do so is of course welcome to). – Stephen Kitt May 27 '18 at 14:13
  • In the future, use dpkg-deb --extract dpkg_version-info.deb /tmp/dpkg to extract the files into /tmp/dpkg – wurtel May 28 '18 at 14:55
  • It worked great for me. Note: in 2020, ver. 10/Buster, archives are .xz not .gz files, but after extracting it works. Must set to executable in order to "fool" apt. – Greg Nickoloff Jun 2 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.