dpkg segfault reading database

Asked by Dave Allmon

I can't install or remove any packages through Synaptic, Ubuntu Software Center, or apt-get. I get this error:

(Reading database ... 65%E: Sub-process /usr/bin/dpkg received a segmentation fault.

The requested log data:

dallmon@poopster:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"
dallmon@poopster:~$ uname -a
Linux poopster 2.6.32-24-generic #41-Ubuntu SMP Thu Aug 19 01:38:40 UTC 2010 x86_64 GNU/Linux
dallmon@poopster:~$ sudo rm /var/lib/apt/lists/lock
[sudo] password for dallmon:
dallmon@poopster:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
dallmon@poopster:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
[sudo] password for dallmon:
dallmon@poopster:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
dallmon@poopster:~$ sudo rm -rf /var/lib/dpkg/updates/*
dallmon@poopster:~$ sudo rm -rf /var/lib/apt/lists
dallmon@poopster:~$ sudo mkdir /var/lib/apt/lists
dallmon@poopster:~$ sudo mkdir /var/lib/apt/lists/partial
dallmon@poopster:~$ sudo rm /var/cache/apt/*.bin
dallmon@poopster:~$ LANG=C;sudo apt-get clean
dallmon@poopster:~$ LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
dallmon@poopster:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  libboost-date-time1.40.0* libboost-thread1.40.0*
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 356kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 95%E: Sub-process /usr/bin/dpkg received a segmentation fault.
dallmon@poopster:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824
Get:1 http://archive.ubuntu.com lucid Release.gpg [189B]
Get:2 http://archive.ubuntu.com lucid-updates Release.gpg [189B]
Get:3 http://archive.ubuntu.com lucid-security Release.gpg [189B]
Get:4 http://archive.ubuntu.com lucid Release [57.2kB]
Get:5 http://archive.ubuntu.com lucid-updates Release [44.7kB]
Get:6 http://archive.ubuntu.com lucid-security Release [38.5kB]
Get:7 http://archive.ubuntu.com lucid/main Packages [1383kB]
Get:8 http://archive.ubuntu.com lucid/restricted Packages [6193B]
Get:9 http://archive.ubuntu.com lucid/main Sources [659kB]
Get:10 http://archive.ubuntu.com lucid/restricted Sources [3775B]
Get:11 http://archive.ubuntu.com lucid/universe Packages [5430kB]
Get:12 http://archive.ubuntu.com lucid/universe Sources [3165kB]
Get:13 http://archive.ubuntu.com lucid/multiverse Packages [176kB]
Get:14 http://archive.ubuntu.com lucid/multiverse Sources [119kB]
Get:15 http://archive.ubuntu.com lucid-updates/main Packages [284kB]
Get:16 http://archive.ubuntu.com lucid-updates/restricted Packages [3270B]
Get:17 http://archive.ubuntu.com lucid-updates/main Sources [103kB]
Get:18 http://archive.ubuntu.com lucid-updates/restricted Sources [1292B]
Get:19 http://archive.ubuntu.com lucid-updates/universe Packages [105kB]
Get:20 http://archive.ubuntu.com lucid-updates/universe Sources [34.9kB]
Get:21 http://archive.ubuntu.com lucid-updates/multiverse Packages [3652B]
Get:22 http://archive.ubuntu.com lucid-updates/multiverse Sources [1508B]
Get:23 http://archive.ubuntu.com lucid-security/main Packages [61.5kB]
Get:24 http://archive.ubuntu.com lucid-security/restricted Packages [14B]
Get:25 http://archive.ubuntu.com lucid-security/main Sources [20.4kB]
Get:26 http://archive.ubuntu.com lucid-security/restricted Sources [14B]
Get:27 http://archive.ubuntu.com lucid-security/universe Packages [33.7kB]
Get:28 http://archive.ubuntu.com lucid-security/universe Sources [7041B]
Get:29 http://archive.ubuntu.com lucid-security/multiverse Packages [1876B]
Get:30 http://archive.ubuntu.com lucid-security/multiverse Sources [573B]
Fetched 11.7MB in 7s (1469kB/s)
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
dallmon@poopster:~$ sudo dpkg --clear-avail
dallmon@poopster:~$ sudo dpkg --configure -a
dallmon@poopster:~$ LANG=C;sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libboost-date-time1.40.0 libboost-thread1.40.0
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
dallmon@poopster:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824 && sudo apt-get dist-upgrade
Hit http://archive.ubuntu.com lucid Release.gpg
Hit http://archive.ubuntu.com lucid-updates Release.gpg
Hit http://archive.ubuntu.com lucid-security Release.gpg
Hit http://archive.ubuntu.com lucid Release
Hit http://archive.ubuntu.com lucid-updates Release
Hit http://archive.ubuntu.com lucid-security Release
Hit http://archive.ubuntu.com lucid/main Packages
Hit http://archive.ubuntu.com lucid/restricted Packages
Hit http://archive.ubuntu.com lucid/main Sources
Hit http://archive.ubuntu.com lucid/restricted Sources
Hit http://archive.ubuntu.com lucid/universe Packages
Hit http://archive.ubuntu.com lucid/universe Sources
Hit http://archive.ubuntu.com lucid/multiverse Packages
Hit http://archive.ubuntu.com lucid/multiverse Sources
Hit http://archive.ubuntu.com lucid-updates/main Packages
Hit http://archive.ubuntu.com lucid-updates/restricted Packages
Hit http://archive.ubuntu.com lucid-updates/main Sources
Hit http://archive.ubuntu.com lucid-updates/restricted Sources
Hit http://archive.ubuntu.com lucid-updates/universe Packages
Hit http://archive.ubuntu.com lucid-updates/universe Sources
Hit http://archive.ubuntu.com lucid-updates/multiverse Packages
Hit http://archive.ubuntu.com lucid-updates/multiverse Sources
Hit http://archive.ubuntu.com lucid-security/main Packages
Hit http://archive.ubuntu.com lucid-security/restricted Packages
Hit http://archive.ubuntu.com lucid-security/main Sources
Hit http://archive.ubuntu.com lucid-security/restricted Sources
Hit http://archive.ubuntu.com lucid-security/universe Packages
Hit http://archive.ubuntu.com lucid-security/universe Sources
Hit http://archive.ubuntu.com lucid-security/multiverse Packages
Hit http://archive.ubuntu.com lucid-security/multiverse Sources
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  ghostscript ghostscript-cups ghostscript-x ifupdown libdjvulibre-text libdjvulibre21 libgs8 libkpathsea5 ubufox
9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 4405kB of archives.
After this operation, 4096B of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://archive.ubuntu.com/ubuntu/ lucid-updates/main ifupdown 0.6.8ubuntu29.1 [62.5kB]
Get:2 http://archive.ubuntu.com/ubuntu/ lucid-updates/main ghostscript 8.71.dfsg.1-0ubuntu5.3 [786kB]
Get:3 http://archive.ubuntu.com/ubuntu/ lucid-updates/main libgs8 8.71.dfsg.1-0ubuntu5.3 [2490kB]
Get:4 http://archive.ubuntu.com/ubuntu/ lucid-updates/main ghostscript-cups 8.71.dfsg.1-0ubuntu5.3 [51.9kB]
Get:5 http://archive.ubuntu.com/ubuntu/ lucid-updates/main ghostscript-x 8.71.dfsg.1-0ubuntu5.3 [70.9kB]
Get:6 http://archive.ubuntu.com/ubuntu/ lucid-updates/main libdjvulibre-text 3.5.22-1ubuntu4.1 [74.6kB]
Get:7 http://archive.ubuntu.com/ubuntu/ lucid-updates/main libdjvulibre21 3.5.22-1ubuntu4.1 [675kB]
Get:8 http://archive.ubuntu.com/ubuntu/ lucid-updates/main libkpathsea5 2009-5ubuntu0.2 [133kB]
Get:9 http://archive.ubuntu.com/ubuntu/ lucid-updates/main ubufox 0.9~rc2-0ubuntu2.1 [61.2kB]
Fetched 4405kB in 12s (361kB/s)
Preconfiguring packages ...
(Reading database ... 65%E: Sub-process /usr/bin/dpkg received a segmentation fault.
dallmon@poopster:~$

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu dpkg Edit question
Assignee:
No assignee Edit question
Solved by:
Dave Allmon
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Reboot and choose an older kernel (if you have oe). Does it boot?
Also in the kernel selection screen select memtest and test your RAM

Revision history for this message
Dave Allmon (dave-allmon) said :
#2

This is odd. I just realized I don't have a boot menu. It just boots into the latest kernel. Anyway, I don't have any problems booting, or running any programs. Everything is perfect - except that I can't install or remove any programs. Always the segfault reading the database.

Revision history for this message
Dave Allmon (dave-allmon) said :
#3

Ok. I ran grub-update and got the boot menu. I tested memory, and indeed I have one trashed bank of memory. I pulled it and repeated the memory tests and all is well with the remaining memory. The database is still hosed, though. I get the same error when I try to install or remove anything.

Revision history for this message
Dave Allmon (dave-allmon) said :
#4

I found the solution. I reinstalled the OS. Kind of takes me back to the Windows days. Anyway, thanks actionparsnip. Your help is appreciated.