E:在apt-get update期间执行脚本APT Update :: Post-Invoke-Success错误时出现问题

我无法安装任何包。 似乎必须运行命令apt-get update但它会抛出一些错误:

 $ sudo apt-get update Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB] Hit:2 http://ve.archive.ubuntu.com/ubuntu xenial InRelease Hit:3 http://ve.archive.ubuntu.com/ubuntu xenial-updates InRelease Hit:4 http://ve.archive.ubuntu.com/ubuntu xenial-backports InRelease Fetched 102 kB in 23s (4337 B/s) *** Error in `appstreamcli': double free or corruption (fasttop): 0x000000000210f4b0 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fac8d8317e5] [...] Aborted (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 > /dev/null; fi' E: Sub-process returned an error code 

全终端output.txt

这对我有用(从这里, https : //forum.siduction.org/index.php?topic = 6174.0 ):

 sudo apt-get purge libappstream3 
 sudo apt install --reinstall libappstream3 

可以解决它。

我来自这个页面并被重定向到这里,在那里我无法回答,但这实际上是该页面的答案。 由于我遇到了同样的问题(至少与其中一个相关问题相同,但是嘿,我没有把它们联系起来,如果对你来说不对,那就很抱歉)并且发现很难找到正确的信息,但最终成功了,我想为什么不在这里分享。 我花了2天晚上把这些碎片放在一起,但这就是我所做的,希望它对你们有些帮助。

我按照这个程序来清理混乱,先做好备份,以防万一。

 sudo apt install appstream/xenial-backports sudo rm /etc/apt/apt.conf.d/50appstream sudo rm /var/cache/app-info/xmls/fwupd.xml sudo apt install --reinstall libappstream4 sudo appstreamcli refresh --force sudo reboot 

不确定是否需要重新启动但重启后我做了:

 sudo appstreamcli refresh --force 

并没有更多的错误。

从16.04 LTS升级到18.04.1 LTS后我遇到了这个问题。 我的初始错误消息是:

 AppStream system cache was updated, but problems were found: Metadata files have errors: /var/cache/app-info/xmls/fwupd.xml 

这是我做的修复它:

 $ sudo rm /var/cache/app-info/xmls/fwupd.xml $ sudo appstreamcli refresh --force 

这导致了这个终端消息:

 AppStream cache update completed successfully. 

然后, sudo apt-get updatesudo apt-get upgrade完美运行。

在我的情况下,清除或重新安装没有帮助。

但是删除apt.conf.d条目确实解决了我的问题。

 Friday 25 August 22:17:45 AEST 2017 LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch Distributor ID: Ubuntu Description: Ubuntu 16.04.3 LTS Release: 16.04 Codename: xenial 

我运行以下命令来摆脱错误:

 sudo apt-get purge libappstream2 sudo rm /etc/apt/apt.conf.d/50appstream 

有这个:

 $ sudo apt-get update
 XXX的[sudo]密码:           
 ...

 AppStream系统缓存已更新,但发现问题:元数据文件有错误:/var/cache/app-info/xmls/fwupd.xml
阅读包裹清单......完成
 E:执行脚本APT :: Update :: Post-Invoke-Success'如果/ usr / bin / test -w / var / cache / app-info -a -e / usr / bin / appstreamcli; 然后appstreamcli刷新缓存> / dev / null; 科幻”
 E:子流程返回错误代码

 $ sudo appstreamcli --version
 AppStream CLI工具版本:0.10.6

 $ sudo appstreamcli refresh-cache --force --verbose
 **(appstreamcli:15334):DEBUG:将/ usr / share / app-info / xmls添加到元数据搜索路径。
 **(appstreamcli:15334):DEBUG:将/ var / lib / app-info / yaml添加到元数据搜索路径。
 **(appstreamcli:15334):DEBUG:将/ var / cache / app-info / xmls添加到元数据搜索路径。
 **(appstreamcli:15334):DEBUG:刷新AppStream缓存
 **(appstreamcli:15334):DEBUG:在/ usr / share / app-info / xmls中搜索数据
 **(appstreamcli:15334):DEBUG:在/ var / cache / app-info / xmls中搜索数据
 **(appstreamcli:15334):DEBUG:在/ var / lib / app-info / yaml中搜索数据
 **(appstreamcli:15334):DEBUG:阅读:/usr/share/app-info/xmls/org.freedesktop.fwupd.xml
 **(appstreamcli:15334):DEBUG:阅读:/var/cache/app-info/xmls/fwupd.xml
 **(appstreamcli:15334):DEBUG:警告:无法解析XML数据:实体:第265行:解析器错误:EntityRef:expecting';'
         

修复是:

 $ sudo -i

 #cd / var / cache / app-info / xmls /

 #ls -l
总计236
 drwxr-xr-x 2 root root 4096 jul 27 09:56 ./
 drwxr-xr-x 5 root root 4096 aug 31 2017 ../
 -rw-r  -  r-- 1 root root 233177 jun 29 16:02 fwupd.xml

 #sed  3ef2bdee8aca2a45b9f53b4d4cce9722523f57f8 

 #sed fwupd.xml -i_BACKUP -re的/ Firmware_SF30 \&SN30_Pro_V1.26.dat / Firmware_SF30 \&SN30_Pro_V1.26.dat / gp'

 #ls -l
总计464
 drwxr-xr-x 2 root root 4096 jul 27 09:57 ./
 drwxr-xr-x 5 root root 4096 aug 31 2017 ../
 -rw-r  -  r-- 1 root root 233328 jul 27 09:57 fwupd.xml
 -rw-r  -  r-- 1 root root 233177 jun 29 16:02 fwupd.xml_BACKUP

 #rm fwupd.xml_BACKUP

 #apt-get update
命中:1 http://se.archive.ubuntu.com/ubuntu xenial InRelease
 ...
获取491 kB in 0s(715 kB / s)                    
阅读包裹清单......完成

 # 出口
登出

 $

注意:
https://github.com/hughsie/lvfs-website/issues/33

18.04.1中的工作解决方案是从Cosmic repos手动安装appstream和libappstream4 ; 选择你的架构和镜像,下载,用dpkg -i安装,然后尝试appstreamcli refresh --force