sudo apt-get remove postgresql
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package postgresql is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 35 not upgraded.
5 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Could not exec dpkg!
E: Sub-process /usr/bin/dpkg returned an error code (100)
答案 0 :(得分:1)
dpkg似乎有问题。如果dpkg有执行位,你可以尝试探索:
ls -l /usr/bin/dpkg
必须是这样的:
-rwxr-xr-x 1 root root 249328 2011-10-06 10:04 /usr/bin/dpkg
如果没有此权限,请尝试:
chmod 655 /usr/bin/dpkg
如果dpkg没有丢失的库,你可以看到。试试这个命令:
ldd /usr/bin/dpkg
你必须看到这样的想法:
ldd /usr/bin/dpkg
linux-vdso.so.1 => (0x00007fff179ff000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007ff8f8439000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff8f809a000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff8f7e95000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff8f8671000)
如果你有另一个相同的系统,你可以尝试从这个好的系统中复制/ usr / bin / dpkg ......
或者您可以尝试检查,如果您在文件系统上有dpkg * .deb,请尝试以下操作:
cp /var/cache/apt/archives/dpkg*deb /tmp
cd /tmp
ar x dpkg*deb data.tar.gz
tar xzf data.tar.gz
cp ./usr/bin/dpkg /usr/bin/
如果您没有dpkg * deb文件ind / var / cache / apt / archives,则需要从存储库中获取它...