Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed ubuntu server 10.04 and booted as normal.

Some time later, I booted the server and tried to install a new package/upgrade the existing packages using:

sudo apt-get upgrade
sudo aptitude safe-upgrade
sudo apt-get install ntp
Reading package lists... Done
Segmentation faulty tree... 50%

I checked the system log /var/log/messages and found these entries:

kernel: [ 5586.184028] apt-get[3864]: segfault at 7fb5e078477b ip 00007fb5da82223c sp 00007fffa943b430 error 6 in[7fb5da7e1000+c5000]
kernel: [ 5682.494467] aptitude[3973]: segfault at 7f06d4c4d77b ip 00007f06d063723c sp 00007fff5feb8540 error 6 in[7f06d05f6000+c5000]
kernel: [ 5991.238428] apt-get[4181]: segfault at 7f809c17e77b ip 00007f809621c23c sp 00007fff740deb30 error 6 in[7f80961db000+c5000]

Also, I got the same error while trying to use aptitude safe-upgrade as it is clear from the log file.

How can this be fixed without system re-installation?

share|improve this question
You might have to download a fresh copy of apt as a deb file and reinstall it using dpkg -i. – Martin Owens -doctormo- Nov 23 '10 at 16:02
up vote 11 down vote accepted

Firstly, try this command (from terminal) as root:

rm -rf /var/cache/apt/*.bin

And try apt-get upgrade again. If the problem still persist, you probably found a bug. Go to launchpad bug and report your problem. Remember to include details like Ubuntu server version or any other relevant information.


share|improve this answer
apt-get check might be a more gentle way of clearing the database error. If that fails, removing the cache as crncosta suggests should hurt nothing. – msw Nov 23 '10 at 16:19
It worked after removing the .bin files as you said. Thanks! – Khaled Nov 23 '10 at 16:24
Thankyouthankyou – yitznewton Mar 30 '12 at 15:35

First I tried

rm -rf /var/cache/apt/*.bin

as mentioned above.

Then I was still getting crashes when I was trying to install/remove something. Either with apt-get or with aptitude.

It was always a segfault in

It turned out that one memory module was corrupt (checked it using memtest86).

After fixing that, I still was getting the same segfaults, so:

  1. Fetched the apt_0.7.25.3ubuntu9.7_i386.deb in /tmp

  2. Extract

    cd /tmp
    ar xv apt_0.7.25.3ubuntu9.7_i386.deb 
  3. Moved the correct file to the correct place

    cd /tmp/usr/lib
    mv -vi* /usr/lib/

all right now.

share|improve this answer

fixed the problem of aptitude(segmentation fault):

  1. my PC running debian wheezy and get segmentation fault run aptitude
  2. vi /etc/apt/source.list
  3. copy an source and correct for sid(复制一条源,把wheezy改成sid保存)
  4. apt-get update
  5. apt-get install aptitude
  6. my aptitude is ok.
share|improve this answer

Your Answer


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.