I cannot install any package. It seems the command apt-get update must be run but it throws some errors:

$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]     
Hit:2 http://ve.archive.ubuntu.com/ubuntu xenial InRelease                     
Hit:3 http://ve.archive.ubuntu.com/ubuntu xenial-updates InRelease             
Hit:4 http://ve.archive.ubuntu.com/ubuntu xenial-backports InRelease           
Fetched 102 kB in 23s (4337 B/s)                                               
*** Error in `appstreamcli': double free or corruption (fasttop): 0x000000000210f4b0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fac8d8317e5]
[...]
Aborted (core dumped)
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 
 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; 
 then appstreamcli refresh > /dev/null; fi'
E: Sub-process returned an error code

Full terminal output.txt

share|improve this question
up vote 31 down vote accepted

This worked for me (From here, https://forum.siduction.org/index.php?topic=6174.0):

sudo apt-get purge libappstream3
share|improve this answer
2  
What about the side effects? What caused this issue? – EdParadox Aug 9 at 18:20
3  
@EdParadox This happened to me yesterday when updating the software in Ubuntu 16.04 immediately after installing it in VirtualBox with the command sudo apt upgrade. This answer worked for me. I was getting many other Apport error notifications at the same time. After updating Oracle VirtualBox and Oracle VirtualBox Extension Pack to the latest version these errors disappeared. I checked in /var/crash/ and verified that all of these errors were related to appstream which has libappstream3 as a dependency. – karel Aug 10 at 7:38
5  
@EdParadox The cause? In my case, the error just happened with no apparent reason, when running sudo apt-get update command in Terminal. The side effect? Nothing apparent besides these packages appstream gnome-software libappstream3 being removed. – clearkimura Aug 11 at 7:50
    
I also had this issue on a fresh install of XUbuntu on VirtualBox. Have no idea why this happens, maybe it has something to do with the virtualisation. But the purge fixed it. – Lion Sep 9 at 13:11
    
@Lion Just did a completely fresh install of XUbuntu 16.04 here on real hardware, I got it right away; I've never had this happen before on any other Linux distro; I'd take a guess and say that there might be something wrong with the installer. – jrh Sep 30 at 3:35
sudo apt install --reinstall libappstream3

can fix it.

share|improve this answer

In my case, purging, or re-installing didn't help.

The removal of the apt.conf.d entry did however solve the issue for me.

Friday 25 August  22:17:45 AEST 2017
LSB Version:    core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
    Distributor ID: Ubuntu
    Description:    Ubuntu 16.04.3 LTS
    Release:    16.04
    Codename:   xenial

I ran the following commands to get rid of the error:

sudo apt-get purge libappstream2
sudo rm /etc/apt/apt.conf.d/50appstream
share|improve this answer

Your Answer

 
discard

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.