Trying to update my web server, apt-get update produces this unhelpful error after reaching 99% while reading package lists at the end:

...
Ign http://mirror.rackspace.com trusty/universe Translation-en_US           
Reading package lists... Error!

If I attempt to install any software or run apt-get upgrade it merely prints ... 0% and fails silently.

In dmesg, I see this worrisome line appearing with each attempt to update or upgrade:

[481989.865258] apt-get[17869]: segfault at ffffffffffffffff ip 00007f56e468fccb sp 00007fff4c83df10 error 5 in libapt-pkg.so.4.12.0[7f56e4639000+145000]

I'm not sure where to go from here!

EDIT: This appears to be a resources/memory issue on this server (512 MB virtual instance really should be bigger). Halting the IPython notebook server and repeating the apt commands was successful.

  • 1
    Ran into this same issue on Digital Ocean with a 512MB ram droplet. Restarting the server to free up some ram fixed the issue. Thanks! – ribeto Apr 16 '15 at 3:01

I experienced the same problem and solved it with sudo dpkg-reconfigure libapt-pkg4.12

source: http://www.schakko.de/2013/08/11/fixing-segmentation-fault-in-libapt-pkg/

It seems that your apt cache file is corrupted.

Open terminal and run following commands.

  • First remove the cache file.

    sudo rm  /var/cache/apt/*.bin
    
  • Now re-create it using

    sudo apt-get update
    sudo apt-get upgrade
    
  • +1 This should work great if the cache is indeed corrupted. – Elder Geek Jul 22 '15 at 23:10

My guess is there may be some disk corruption to the apt-get package! Can you try running sudo apt-get install aptitude and see what that does? If you can install aptitude, it works as an alternative to apt-get and you can also run sudo aptitude reinstall apt-get and see if it's able to repair apt-get! :)

We ran into a similar issue and it was a VM that had been given too little memory. Increasing RAM to 1G solved the issue for us.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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