Lately there seems to be a rash of the APT package management system suddenly dying on Debian / Ubuntu based systems.Â Troubleshooting this on a Linux Mint 17 install using MATE, we discovered several possible palliative measures along with a working solution to the problem of apt hitting a segmentation fault and crashing during cache loading.
- Synaptic and Software Manager simply don’t start at all, bombing out silently before displaying the UI.
- Update Manager always displays “Your system is up to date” even after manually refreshing.
- apt-get update breaks and reports a segmentation fault:
... Ign http://archive.ubuntu.com trusty/universe Translation-en_US Fetched 3,438 kB in 27s (125 kB/s) Segmentation fault E: Problem executing scripts APT::Update::Post-Invoke-Success 'test -x /usr/bin/apt-show-versions || exit 0 ; apt-show-versions -i' E: Sub-process returned an error code
- aptitude will display “Loading Cache” and then bomb out with the unhelpful message “Ouch! Got SIGSEGV, dying..”
The first thing to check on the troubled system is dmesg and syslog for clues:
$ dmesg | grep apt Oct 8 10:28:22 etown kernel: [ 4807.432466] aptitude: segfault at 7f13ee640fc4 ip 00007f13f21180d7 sp 00007fff1d7ce6a0 error 6 in libapt-pkg.so.4.12.0[7f13f2029000+144000] $syslog | grep apt Oct 8 11:01:48 etown kernel: [ 6814.538186] apt-show-versio: segfault at 7f56ef3cdfc4 ip 00007f56f04310d7 sp 00007ffd2bb5e060 error 6 in libapt-pkg.so.4.12.0[7f56f0342000+144000]
So either log can provide us with a clue as to what’s going on – in this case, a segfault originating in the library
Fortunately, a work around can be found in the comments courtesy of Ken Sharp (kennybobs).Â All one need do (as root) is to edit /etc/apt/apt.conf.d/70debconf and add the following setting to the end of the file:Â
This will allot enough memory for apt to run without segfault.
Other methods that were tried and failed included
- Increasing the cache size using a different setting in /etc/apt/apt.conf.d/70debconf:
- Cleaning out the apt cache manually, in case it had been corrupted:
$ sudo rm /var/cache/apt/*.bin* $ sudo apt-get update && sudo apt-get upgrade
- Forcing dpkg to reconfigure libapt-pkg4.12 in case of corrupted or badly tweaked config files:
$ sudo dpkg-reconfigure libapt-pkg4.12 $ sudo apt-get update && sudo apt-get upgrade