apt-get update ending in Problem executing scripts APT::Update::Post-Invoke-Success

September 30, 2014 17.3k views

I have recently added node sources to my Ubuntu 14.04 droplet (the LEMP package) and today when trying to run apt-get update I’m getting following error message:

Ign http://apt.newrelic.com newrelic/non-free Translation-en
Get:5 https://deb.nodesource.com trusty/main Translation-en_US
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Ign https://deb.nodesource.com trusty/main Translation-en_US
Ign https://deb.nodesource.com trusty/main Translation-en
Fetched 6,413 B in 4s (1,566 B/s)
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

The package list seems to be read but at the end there’s this error. The only sensible solution I found googling is to remove apt-show-versions package if I don’t use it. I haven’t done that yet, hoping I would find another solution.

Thanks in advance.

1 comment
  • I have tried reinstalling the apt-show-versions package, removal went smoothly, the subsequent installation however did not:

    vps sources.list.d # apt-get install apt-show-versions
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 0 B/33.9 kB of archives.
    After this operation, 173 kB of additional disk space will be used.
    Selecting previously unselected package apt-show-versions.
    (Reading database ... 101099 files and directories currently installed.)
    Preparing to unpack .../apt-show-versions_0.22.3_all.deb ...
    Unpacking apt-show-versions (0.22.3) ...
    Processing triggers for man-db ( ...
    Setting up apt-show-versions (0.22.3) ...
    ** initializing cache. This may take a while **
    dpkg: error processing package apt-show-versions (--configure):
     subprocess installed post-installation script returned error exit status 137
    Errors were encountered while processing:
    E: Sub-process /usr/bin/dpkg returned an error code (1)
4 Answers

What’s the memory usage on the droplet look like? My first guess would be that apt-show-versions is running out of memory while initializing its cache based on:

** initializing cache. This may take a while **

If you haven’t done so yet, try adding a swap file.

by Justin Ellingwood
Swap space can be used as an "overflow" area for your system when you run out of RAM. The operating system can store data that would normally be kept in RAM on the hard drive in a specially formatted file. In this guide, we'll demonstrate how to create and use one of these files in Ubuntu 14.04.

My error wasn’t exactly the same–mine was just saying Killed. After messing around with it for a while, a reboot fixed it.

Im having a similar behaviour:

Suddenly im having issues with my apt upgrade

Excuting: apt-update & apt-upgrade -y I'm getting this error:

Max. recursion depth with nested structures exceeded at /usr/local/lib/perl/5.18.2/Storable.pm line 278, at /usr/bin/apt-show-versions line 271.
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

I reinstalled apt-show-versions
I upgraded CPAN modules

It’s a bug in apt-show-versions, which is apparently fixed in the next version (0.22.9) - check out https://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=912695

Have another answer? Share your knowledge.