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

2 Answers 2


Remove libappstream3 with the CLI command

sudo apt-get remove libappstream3


sudo apt remove libappstream3

Afterwards, apt update should work fine again.

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

  • 4
    sudo apt-get purge libappstream3 did the work for me Commented Nov 19, 2017 at 19:43
  • 2
    worked for me as well Commented Jul 31, 2018 at 10:40
  • 6
    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
    Commented Aug 31, 2018 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.
    – FAQ
    Commented Sep 21, 2018 at 16:31
  • 7
    And now it's sudo apt-get purge libappstream4 :)
    – sr9yar
    Commented Dec 15, 2020 at 11:59

(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.

  • 4
    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
    Commented Jul 7, 2018 at 15:42
  • The comment from @Nikola fixed it for me.
    – aGer
    Commented Jul 15, 2018 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
    Commented Jul 16, 2018 at 9:06

Not the answer you're looking for? Browse other questions tagged .