sudo apt-get update 时出现错误
1.错误如下:
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
2.网上的教程大部分都是依此运行如下三个命令:
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
sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb
但是我这里,运行第第二个、三个命令的时候,依然会报错,报错大致如下:
Unable to locally verify the issuer's authority.
To connect to launchpad.net insecurely, use `--no-check-certificate'.
--2021-10-28 23:45:12-- https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb
Connecting to launchpad.net (launchpad.net)|91.189.89.223|:443... connected.
ERROR: cannot verify launchpad.net's certificate, issued by ‘CN=R3,O=Let's Encrypt,C=US’:Unable to locally verify the issuer's authority.
To connect to launchpad.net insecurely, use `--no-check-certificate'.
3.最终解决办法,如下:
sudo apt-get purge libappstream3
运行上述命令,安装这个依赖后
重新
sudo apt-get update
即可成功