Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I did an aptitude apt-get and then aptitude upgrade, on an Ubuntu 12.04 box, and got:

root@li393-189:~# aptitude upgrade
Resolving dependencies...                
The following packages will be upgraded:
  accountsservice apache2 apache2-mpm-prefork apache2-utils apache2.2-bin 
  apache2.2-common apparmor apport apt-transport-https apt-utils bind9-host 
  dmsetup dnsutils icedtea-6-jre-cacao icedtea-6-jre-jamvm initramfs-tools 
  initramfs-tools-bin iptables isc-dhcp-client isc-dhcp-common 
  postfix-doc python-apport python-problem-report rsyslog sudo
  ubuntu-minimal udev upstart
The following partially installed packages will be configured:
  apt
The following packages are RECOMMENDED but will NOT be installed:
  firefox-locale-en libssl-doc
76 packages upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
Need to get 4,168 kB/60.3 MB of archives. After unpacking 1,225 kB will be used.
Do you want to continue? [Y/n/?] Y
Get: 1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libdevmapper1.02.1 i386 2:1.02.48-4ubuntu7.3 [67.4 kB]
Get: 2 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main dmsetup i386 2:1.02.48-4ubuntu7.3 [36.9 kB]
Get: 3 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libxml2 i386 2.7.8.dfsg-5.1ubuntu4.4 [662 kB]
Get: 4 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main rsyslog i386 5.8.6-1ubuntu8.1 [431 kB]
Get: 5 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main bind9-host i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [54.0 kB]
Get: 6 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main dnsutils i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [143 kB]
Get: 7 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libisc83 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [161 kB]
Get: 8 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libdns81 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [705 kB]
Get: 9 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libisccc80 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [18.0 kB]
Get: 10 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libisccfg82 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [40.3 kB]
Get: 11 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main liblwres80 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [38.8 kB]
Get: 12 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libbind9-80 i386 1:9.8.1.dfsg.P1-4ubuntu0.6 [24.4 kB]
Get: 13 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libruby1.8 i386 1.8.7.352-2ubuntu1.2 [1,787 kB]
Fetched 4,168 kB in 0s (11.4 MB/s) 
Extracting templates from packages: 100%
Preconfiguring packages ...
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
Setting up apt (0.8.16~exp12ubuntu10.10) ...
gpg: error while loading shared librariesgpg: error while loading shared libraries: libgdbm.so.2: cannot open shared object file: No such file or directory
: libgdbm.so.2: cannot open shared object file: No such file or directory
dpkg: error processing apt (--configure):
 subprocess installed post-installation script returned error exit status 127
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 apt
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up apt (0.8.16~exp12ubuntu10.10) ...
gpg: error while loading shared libraries: libgdbm.so.2: cannot open shared object file: No such file or directory
gpg: error while loading shared libraries: libgdbm.so.2: cannot open shared object file: No such file or directory
dpkg: error processing apt (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 apt 

How can I address this error and both upgrade to the latest Ubuntu 12.04 release, and then upgrade the distribution to the latest 12.10 release?

share|improve this question

3 Answers 3

It looks like you interrupted an upgrade before and apt paid the price.

This should get you back on your merry way.

wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt_0.7.9ubuntu17_i386.deb
dpkg -i apt_0.7.9ubuntu17_i386.deb
share|improve this answer

apt is not fully configured. “Configured” here means that the files are present on the disk, but something that is necessary for the program to work hasn't been done (it can be installing another package, updating a library database, creating a configuration file, …).

Run apt-get -f install or dpkg --configure -a to finish configuring half-configured packages. If neither of these commands work, update your question with the transcript from running them.

share|improve this answer

apt being broken is only incidental. The real problem is that gpg can't load the libgdbm shared library. You'll need to replace that before doing anything else.

To get the 12.04 version:

curl -LOC - http://archive.ubuntu.com/ubuntu/pool/main/g/gdbm/libgdbm3_1.8.3-10_i386.deb
dpkg -i libgdbm3_1.8.3-10_i386.deb

To get the 12.10 version:

curl -LOC - http://kr.archive.ubuntu.com/ubuntu/pool/main/g/gdbm/libgdbm3_1.8.3-11_i386.deb
dpkg -i libgdbm3_1.8.3-11_i386.deb

I don't know for sure exactly which one you'll need for the version of apt you've got, but either should work. My suggestion, though, would be to try 12.04 first, then 12.10. After you fix this, everything should start working again. If not, try Georgyo's suggestion.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.