当前位置: 代码迷 >> 综合 >> sudo apt update报错:E: Problem executing scripts APT::Update::Post-Invoke-Success ‘if /usr/bin/test -w
  详细解决方案

sudo apt update报错:E: Problem executing scripts APT::Update::Post-Invoke-Success ‘if /usr/bin/test -w

热度:41   发布时间:2023-12-15 16:19:26.0

完整报错:

$ sudo apt update
...
(appstreamcli:27333): GLib-CRITICAL **: g_strchug: assertion 'string != NULL' failed(appstreamcli:27333): GLib-CRITICAL **: g_strchomp: assertion 'string != NULL' failed
free(): double free detected in tcache 2
Aborted (core dumped)
Reading package lists... Done
W: http://files.freeswitch.org/repo/ubuntu-1604/freeswitch-1.6/dists/xenial/InRelease: Signature by key ACAD66137D22A8A469FBB57F1FDDF413C2B201E5 uses weak digest algorithm (SHA1)
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

解决:

$ sudo pkill -KILL appstreamcli
$ wget -P /tmp https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb --no-check-certificate
$ sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb
$ sudo apt update

https://blog.csdn.net/csdnjyc/article/details/84594511

  相关解决方案