76

appstreamcli is overheating my laptop by constantly using 100% of a core. My only solution is to kill it. Here's a screenshot of top:

output of top showing appstreamcli with 100% cpu usage

I can kill appstreamcli with either sudo kill pid or sudo killall appstreamcli. But once I do sudo apt update, the appstreamcli process returns again and hangs the update. If I then kill it, I get the following output:

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

What is this process and why is it using so much CPU?

8
  • 2
    It's a bug. See this question: askubuntu.com/questions/774918/…
    – alwaysask
    May 20, 2016 at 4:10
  • 9
    68 degrees is a good temperature to cook an egg, but you will need much higher temperatures to cook a laptop. May 20, 2016 at 10:44
  • @MichaelHampton My laptop gets cooked when some dumb kernel process takes all the CPU time; it gets up to 100 degrees celcius pretty easily. Then it switches off.
    – cat
    May 20, 2016 at 18:12
  • @cat Right, 100 is the magic number where your laptop is cooking. Might be worth cleaning out its fan and redoing the thermal paste on its CPU. May 20, 2016 at 18:13
  • @MichaelHampton 100 is the magic number at which the CPU says, "I'm switching off or else I will Halt and Catch Fire!!!". The fan is clean and the thermal paste new, it's just old.
    – cat
    May 20, 2016 at 18:15

2 Answers 2

79

This is caused by a bug https://bugs.launchpad.net/ubuntu/+source/appstream/+bug/1579712
The working solution (just tried myself):

First kill appstreamcli, either manually or with

sudo kill -KILL $(pgrep appstreamcli)

or

sudo pkill -KILL appstreamcli

Then:

wget -P /tmp https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb
sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb

After this you will be able to proceed with apt-get update as usual

7
  • 12
    Exactly my problem , but what is appstreamcli by the way ? May 20, 2016 at 7:35
  • 17
    Be careful, this works on a 64-bit system; on a 32-bit, you have to change amd64 to i386 in the links.
    – Rmano
    May 20, 2016 at 8:07
  • 1
    To do after sudo kill {pid} to pass the "dpkg status database is locked by another process" error.
    – Andrea
    May 20, 2016 at 9:37
  • The problem is that appstreamcli is being run as root, so to bypass the database lock, just do: sudo killall appstreamcli
    – notAWasp
    May 20, 2016 at 10:06
  • 2
    Since this bug manifests itself on a very rare occasion (according to the description), the fix has to be tested through a test case. Running sudo appstreamcli refresh --force without hanging will confirm that the fix works. It worked for me. Thank you for the solution!
    – nolexa
    May 20, 2016 at 10:08
2

Alternatively for what ever reason, if you don't want to install an out of repo package and just wait for an update you can uninstall it completely.

This will remove Discover on KDE:Plasma so I assume it will also remove the Gnome Software, or what ever your Ubuntu Flavor adds. If this is the case you can just use Muon on Kubuntu, or Synaptic on GTK based DEs.

Before you run this make sure you check the packages being removed to make sure that is ok with you.

You can figure out what something is by running

apt show appstream

to uninstall appstream run

sudo apt remove appstream

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