报错信息如下
(appstreamcli:13767): GLib-CRITICAL **: 08:57:18.126: 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:13767): GLib-CRITICAL **: 08:57:18.126: g_variant_new_variant: assertion 'value != NULL' failed
(appstreamcli:13767): GLib-ERROR **: 08:57:18.126: 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
只需要执行下面的命令行:
apt-get install --reinstall libappstream4
但是会出现其他报错
Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
这个错误通常意味着有另一个进程正在使用apt命令或dpkg命令,因此无法获得对dpkg锁的访问权限。以下是解决步骤:
确认是否有其他apt或dpkg进程正在运行。可以使用以下命令:
ps aux | grep -i apt
ps aux | grep -i dpkg
如果有其他进程正在运行,请等待它完成并退出。
如果没有其他进程正在运行,则需要清理锁定文件。可以使用以下命令:
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
这将删除apt和dpkg使用的所有锁定文件。
然后,强制重新配置dpkg数据库:
sudo dpkg --configure -a
最后,更新软件包列表:
sudo apt update