user1213147
user1213147

Reputation: 1

how to rectify this error while removing postgresql

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)

Upvotes: 0

Views: 379

Answers (1)

Jan Marek
Jan Marek

Reputation: 11180

It seems to be problem with dpkg. Can you try explore, if dpkg have an execute bit:

ls -l /usr/bin/dpkg

It must be like this:

-rwxr-xr-x 1 root root 249328 2011-10-06 10:04 /usr/bin/dpkg

If it have not this rights, try:

chmod 655 /usr/bin/dpkg

You can see, if there is not some missing libraries for dpkg. Try this command:

ldd /usr/bin/dpkg

You have to seen somethink like this:

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)

If you have another same system as this, you can try to copy /usr/bin/dpkg from this good system...

Or you can try to check, if you have dpkg*.deb on filesystem, and try this:

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/

If you will don't have a dpkg*deb file ind /var/cache/apt/archives , you will need to fetch it from repository...

Upvotes: 1

Related Questions