2012-02-16 46 views
0
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) 

回答

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 

你有見過somethink這樣的:

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,則需要從存儲庫中獲取它...