Suramya's Blog : Welcome to my crazy life…

August 24, 2018

Fixing the appstreamcli error when running apt-get update

Filed under: Computer Software,Knowledgebase,Linux/Unix Related,Tech Related — Suramya @ 12:05 AM

Over the past few days everytime I tried to update my Debian system using apt-get it would fail with the following error message:

(appstreamcli:5574): GLib-CRITICAL **: 20:49:46.436: g_variant_builder_end: assertion '!GVSB(builder)->uniform_item_types || 
GVSB(builder)->prev_item_type != NULL || g_variant_type_is_definite (GVSB(builder)->type)' failed

(appstreamcli:5574): GLib-CRITICAL **: 20:49:46.436: g_variant_new_variant: assertion 'value != NULL' failed

(appstreamcli:5574): GLib-ERROR **: 20:49:46.436: g_variant_new_parsed: 11-13:invalid GVariant format string
Trace/breakpoint trap
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-cache > 
/dev/null; fi'
E: Sub-process returned an error code

Spent a couple of hours trying to figure out what was causing it and was able to identify that it was caused because of a bug in appstream as tunning the command manually also failed with the same error. When I tried to remove the package as recommended by a few sites it would have removed the entire KDE desktop from my machine which I didn’t want so I was at a loss as to how to fix the problem. So I put the update on hold till I had a bit more time to research the issue and identify the solution.

Today I got some free time and decided to try again and after a little bit of searching stumbled upon the following Bug Report (#906544) where David explained that the error was caused due to a bug in the upstream version of appstream and a little while later Matthias commented that the issue is fixed in the latest version of the software and it would flow down to the Debian repositories in a little bit. Normally I would have just done an apt-get update and then install to get the latest package but since the whole issue was that I couldn’t get the system to finish the update command I had to manually install the package.

To do that I went to the Debian site and opened the software package list for Debian Unstable (as that is what I am using) and searched for appstream. This gave me a link to the updated package (0.12.2-2) that fixed the bug (I had 0.12.2-1 installed). Once I downloaded the package (Make sure you download the correct package based on your system architecture) I manually installed it using the following command as root:

dpkg -i appstream_0.12.2-2_amd64.deb

This installed the package and I was then able to do an apt-get update successfully. I still get the GLib-CRITICAL warnings but that apparently can be ignored without issues.

Hope this helps people who hit the same issue (or reminds me of the solution if/when I hit the issue again).

– Suramya


  1. Hi Suramya,

    Thanks for helping me out! Saved me a quite some time 🙂

    Best regards,

    Comment by HNK — August 28, 2018 @ 1:47 AM

  2. Glad you found this useful 🙂

    – Suramya

    Comment by Suramya — August 29, 2018 @ 5:33 PM

  3. Helped get my Debian Buster updated, thanks.

    Comment by Jo Radcliffe — September 1, 2018 @ 7:18 PM

  4. Cool. Glad it helped.

    – Suramya

    Comment by Suramya — September 4, 2018 @ 7:00 PM

  5. great, thx

    Comment by seangeil — September 7, 2018 @ 6:25 PM

  6. Hi Suramya,

    Very efficient workaround. Great.
    Many thanks

    Comment by PA — September 11, 2018 @ 1:59 AM

  7. Dear Surabaya thanks for the post. Unfortunately I get the same error (as for apt update) also while performing dpkg -i appstream_0.12.2-2_amd64.deb

    Can anyone help me?
    thanks in advance

    Comment by Gregorio — September 11, 2018 @ 4:42 PM

  8. Dear All

    I solved it updating libc6 and libappstream4 separately.

    Now it works again.

    Thanks anyway

    Comment by Gregorio — September 11, 2018 @ 4:55 PM

  9. Hi,

    I am not sure who you are asking for help ’cause I am not *Surabaya* and nor do I know anyone by that name. It is simple curtsy to atleast spell someone’s name correctly if you are asking them for help (Actually you should do that regardless).

    Anyways, glad that you got the issue resolved.

    – Suramya

    Comment by Suramya — September 12, 2018 @ 2:16 PM

  10. Thankyou! Extremely helpful, really appreciate you publishing this.

    Comment by David — September 19, 2018 @ 9:06 PM

  11. You’ve saved me a bunch. Thanks alot

    Comment by Michael Kalhari — July 27, 2020 @ 1:06 AM

  12. Glad my post was able to help. Thanks for letting me know. 🙂

    – Suramya

    Comment by Suramya — July 30, 2020 @ 2:27 PM

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress