我无法升级我的 ubuntu 18.04 这是日志,
Fetched 427 MB in 45s (9,542 kB/s)
Extracting templates from packages: 100%
Preconfiguring packages ...
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
我尝试了在谷歌上找到的所有解决方案但都没有用。
echo $PATH
Output: /home/bs204/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/dart/bin
which start-stop-daemon
No output
Output cat /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
答案1
我找到了我的问题的解决方案。
sudo -i
mkdir /tmp
mkdir /tmp/dpkg
cd /tmp/dpkg
wget http://security.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.19.7ubuntu1_amd64.deb
ar -x dpkg_1.19.7ubuntu1_amd64.deb
tar -xf data.tar.xz
cp ./sbin/start-stop-daemon /sbin
如果 dpkg 损坏:
cp ./usr/bin/dpkg /usr/bin/
apt update
apt install --reinstall dpkg
apt upgrade
答案2
谢谢,这帮助我解决了我的问题:
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
您的好解决方案的一个补充:在我的 OMV 系统上,我没有“ar”,所以我使用命令
"dpkg-deb -x dpkg_1.19.7ubuntu1_amd64.deb ."