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 Answers 2

5

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!

5
  • @dirkt please explain the evidence that makes you guess that systemd blindly deleted files which belong to the dpkg package.
    – sourcejedi
    May 27, 2018 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). May 27, 2018 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, 2018 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.
    – gnicko
    Jun 2, 2020 at 13:13
  • It worked for recover start-stop-daemon and ldconfig(from libc-bin) debian 11/Bullseye rescue.
    – gvd
    Sep 20, 2021 at 0:27
3

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .