我该如何修复 dpkg 错误代码(100)

我该如何修复 dpkg 错误代码(100)

我无法安装任何包,即使dpkg我的dpkg文件和文件夹已被删除,并且收到此错误:

Could not exec dpkg!
E: Sub-process /usr/bin/dpkg returned an error code (100)

编辑: 当我运行时sudo apt-get update && sudo apt-get install --reinstall dpkg 我得到了这个输出:

dpkg: warning: 'dpkg-deb' 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)

编辑

安装 buddgie 桌面时

The following packages have unmet dependencies:
 budgie-desktop-environment : Depends: budgie-lightdm-theme (>= 0.5.4) but it is not going to be installed
                          Depends: plymouth-themes but it is not installable
                          Recommends: arc-firefox-theme but it is not going to be installed
                          Recommends: pocillo-icon-theme but it is not going to be installed
                          Recommends: budgie-indicator-applet but it is not going to be installed
                          Recommends: vertex-theme but it is not going to be installed
                          Recommends: gthumb but it is not installable
                          Recommends: rhythmbox-plugin-alternative-toolbar but it is not installable
                          Recommends: menulibre but it is not installable
                          Recommends: transmission but it is not installable
                          Recommends: tlp but it is not installable
                          Recommends: budgie-welcome but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

答案1

您可能需要通过执行以下操作来重新安装 dpkg:

sudo -i
mkdir /tmp/dpkg

cd /tmp/dpkg

请注意,你可能需要查看下载链接是否仍然是最新的

如果你运行的是 32 位版本的 ubuntu

wget http://security.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.17.5ubuntu5.2_i386.deb

对于 64 位

wget http://security.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.17.5ubuntu5.7_amd64.deb

然后

ar x dpkg*.deb data.tar.gz

tar xfvz data.tar.gz ./usr/bin/dpkg

现在将二进制文件复制/usr/bin

sudo cp ./usr/bin/dpkg /usr/bin

最后运行

sudo apt-get update
sudo apt-get install --reinstall dpkg

相关内容