{"id":2981,"date":"2018-08-24T00:05:11","date_gmt":"2018-08-23T18:35:11","guid":{"rendered":"https:\/\/www.suramya.com\/blog\/?p=2981"},"modified":"2022-06-16T15:19:18","modified_gmt":"2022-06-16T09:49:18","slug":"fixing-the-appstreamcli-error-when-running-apt-get-update","status":"publish","type":"post","link":"https:\/\/www.suramya.com\/blog\/2018\/08\/fixing-the-appstreamcli-error-when-running-apt-get-update\/","title":{"rendered":"Fixing the appstreamcli error when running apt-get update"},"content":{"rendered":"<p>Over the past few days everytime I tried to update my Debian system using apt-get it would fail with the following error message:<\/p>\n<pre class='code'>(appstreamcli:5574): GLib-CRITICAL **: 20:49:46.436: g_variant_builder_end: assertion '!GVSB(builder)->uniform_item_types || \r\nGVSB(builder)->prev_item_type != NULL || g_variant_type_is_definite (GVSB(builder)->type)' failed\r\n\r\n(appstreamcli:5574): GLib-CRITICAL **: 20:49:46.436: g_variant_new_variant: assertion 'value != NULL' failed\r\n\r\n(appstreamcli:5574): GLib-ERROR **: 20:49:46.436: g_variant_new_parsed: 11-13:invalid GVariant format string\r\nTrace\/breakpoint trap\r\nReading package lists... Done\r\nE: 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 > \r\n\/dev\/null; fi'\r\nE: Sub-process returned an error code<\/pre>\n<p>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&#8217;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. <\/p>\n<p>Today I got some free time and decided to try again and after a little bit of searching stumbled upon the following Bug Report (<a href=\"https:\/\/bugs.debian.org\/cgi-bin\/bugreport.cgi?bug=906544\">#906544<\/a>) where <em>David<\/em> explained that the error was caused due to a bug in the upstream version of appstream and a little while later <em>Matthias<\/em> 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&#8217;t get the system to finish the update command I had to manually install the package.<\/p>\n<p>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 <a href=\"https:\/\/packages.debian.org\/unstable\/appstream\">link<\/a> 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:<\/p>\n<pre class='code'>dpkg -i appstream_0.12.2-2_amd64.deb<\/pre>\n<p>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.<\/p>\n<p>Hope this helps people who hit the same issue (or reminds me of the solution if\/when I hit the issue again).<\/p>\n<p>&#8211; Suramya<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8216;!GVSB(builder)->uniform_item_types || GVSB(builder)->prev_item_type != NULL || g_variant_type_is_definite (GVSB(builder)->type)&#8217; failed (appstreamcli:5574): GLib-CRITICAL **: 20:49:46.436: g_variant_new_variant: assertion &#8216;value != NULL&#8217; failed (appstreamcli:5574): GLib-ERROR **: 20:49:46.436: g_variant_new_parsed: 11-13:invalid GVariant [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":""},"categories":[18,24,13,2],"tags":[],"class_list":["post-2981","post","type-post","status-publish","format-standard","hentry","category-computer-software","category-knowledgebase","category-linuxunix-related","category-techie-stuff"],"_links":{"self":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/2981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/comments?post=2981"}],"version-history":[{"count":6,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/2981\/revisions"}],"predecessor-version":[{"id":2987,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/2981\/revisions\/2987"}],"wp:attachment":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/media?parent=2981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/categories?post=2981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/tags?post=2981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}