i wrote a small script to remove and purging some packages and install new one within chroot environment(debian 9), but when i run the script i got this error when the script running the purging command:

Fetched 355 B in 4s (88 B/s)       
(appstreamcli:8321): GLib-CRITICAL **: 14:31:37.785: 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:8321): GLib-CRITICAL **: 14:31:37.785: g_variant_new_variant: assertion 'value != NULL' failed
(appstreamcli:8321): GLib-ERROR **: 14:31:37.785: g_variant_new_parsed: 11-13:invalid GVariant format string
Trace/breakpoint trap (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-cache > /dev/null; fi'
E: Sub-process returned an error code
Reading package lists... Done

and this is my script:

mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts

export HOME=/root
export LC_ALL=C

apt update
apt-get remove --purge -y gnome* kodi* tilix* rhythmbox*
apt -y autoremove
apt install -y mate-desktop-environment-extras gparted vlc gksu
apt-get purge --no-install-recommends -y linux-image-4.16* linux-image-4.17*
apt -y autoremove
umount /proc || umount -lf /proc
umount /sys
umount /dev/pts


so, how can i fix this error ?

closed as off-topic by Jeff Schaller, A.B, Mr Shunz, RalfFriedl, JigglyNaga Jan 13 at 20:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, A.B, Mr Shunz, RalfFriedl, JigglyNaga
If this question can be reworded to fit the rules in the help center, please edit the question.


after searching, i solved my problem by purging the appstream package inside chroot:

# apt purge appstream

and then executing the purging command with autoremove command :

# apt-get remove --purge -y gnome* kodi* tilix* rhythmbox* && apt autoremove

and reinstalling appstearm package again


I ran into a similar issue when running

sudo apt-get upgrade

I had almost the identical error The console recommended I run the following:

sudo apt --fix-broken install

and that resolved the error for me.

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