25

I am getting the following error when I run sudo apt update

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

marked as duplicate by Zanna, karel, Eric Carvalho, Fabby, Andrea Lazzarotto Aug 14 '17 at 14:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

53

Remove libappstream3 with the CLI command

sudo apt-get remove libappstream3

or

sudo apt remove libappstream3

Afterwards, apt update should work fine again.

Source: https://forum.siduction.org/index.php?topic=6174.0

  • 2
    sudo apt-get purge libappstream3 did the work for me – Srinivas Reddy Thatiparthy Nov 19 '17 at 19:43
  • worked for me as well – revolutionary Jul 31 '18 at 10:40
  • 1
    My Debian would uninstall apt-config-icons* gnome-software* gstreamer1.0-packagekit* libappstream4* packagekit* packagekit-tools* if I uninstalled libappstream4. This was too risky so I decided to reinstall libappstream4 sudo apt-get install --reinstall libappstream4 and this fixed the problem too. – Hung Tran Aug 31 '18 at 9:34
  • On my Ubuntu-Desktop 16.04 I have: The following packages have unmet dependencies: appstream : Depends: libappstream3 (>= 0.9.3) but it is not going to be installed code : Depends: libnss3 (>= 2:3.26) but 2:3.21-1ubuntu4 is to be installed It's libnss3 cyclic dependency which I can't reinstall but I'm trying. – Владимир Смирнов Sep 21 '18 at 16:31
5

(in Matthias' comment https://bugs.launchpad.net/ubuntu/+source/appstream/+bug/1579712/comments/24 on bug #1579712) worked for me.

Removing /usr/bin/appstreamcli is fine if you install the fixed package afterwards.

To install this manually, please do (for amd64, adjust URLs for other architectures):

cd /tmp && mkdir asfix
cd asfix
wget https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb
wget https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb
sudo dpkg -i *.deb

This should solve the issue.

  • 3
    I have had the same problem and the problem was that there was (in my case) an inaproprietly escaped chacter in the file /var/cache/app-info/xmls/fwupd.xml on line 265, which broke the xml, hence the error. the line <checksum filename="Firmware_SF30&SN30_Pro_V1.26.dat" target="content" type="sha1">3ef2bdee8aca2a45b9f53b4d4cce9722523f57f8</checksum> , the & symbol must be encoded &amp; for this to be a valid xml – Nikola Jul 7 '18 at 15:42
  • The comment from @Nikola fixed it for me. – aGer Jul 15 '18 at 9:47
  • @aGer yeah it fixes it, bit now another problem, once the list is refreshed, the probem appears again, so this is not a good solution – Nikola Jul 16 '18 at 9:06

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