本文记录在使用 Ubuntu 过程中,处理
sudo apt update
报错的笔记.
Q&A 1.
1.问题详情:
$ sudo apt update
Reading package lists... Done
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
2.解决方法:
sudo rm -rf /var/lib/apt/lists/
如果仍未解决,继续输入下面的命令
sudo rm -f /var/cache/apt/archives/lock
sudo rm -f /var/lib/dpkg/lock
sudo dpkg --configure -a
Q&A 2.
1.问题详情:
$ sudo apt update
Get:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial InRelease [247 kB]
...
...
Get:80 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security/multiverse DEP-11 64x64 Icons [2,638 B]
Fetched 44.6 MB in 24s (1,800 kB/s)
*** Error in `appstreamcli': double free or corruption (fasttop): 0x00000000027c2b30 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x77725)[0x7f55b0090725]
/lib/x86_64-linux-gnu/libc.so.6(+0x7ff4a)[0x7f55b0098f4a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f55b009cabc]
/usr/lib/x86_64-linux-gnu/libappstream.so.3(as_component_complete+0x439)[0x7f55b0414d19]
/usr/lib/x86_64-linux-gnu/libappstream.so.3(as_data_pool_update+0x44a)[0x7f55b0415f0a]
/usr/lib/x86_64-linux-gnu/libappstream.so.3(as_cache_builder_refresh+0x1c2)[0x7f55b040b272]
appstreamcli(ascli_refresh_cache+0x12e)[0x4049de]
appstreamcli(as_client_run+0x6fb)[0x403ceb]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f55b0039830]
appstreamcli(_start+0x29)[0x403519]
======= Memory map: ========
00400000-00408000 r-xp 00000000 08:06 395814 /usr/bin/appstreamcli
00607000-00608000 r--p 00007000 08:06 395814 /usr/bin/appstreamcli
...
...
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
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
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
Q&A 3.
1.问题详情:
$ sudo apt-get update
Hit:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial InRelease
...
...
Get:12 https://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,093 B]
Fetched 6,195 B in 3s (1,887 B/s)
Reading package lists... Done
W: GPG error: https://repo.fdzh.org/chrome/deb stable Release: The following signatures were invalid: KEYEXPIRED 1555048520 KEYEXPIRED 1579833932 KEYEXPIRED 1555048520 KEYEXPIRED 1555048520 KEYEXPIRED 1579833932 KEYEXPIRED 1555048520 KEYEXPIRED 1579833932
W: The repository 'https://repo.fdzh.org/chrome/deb stable Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
这是由于 /etc/apt/sources.list.d/google-chrome.list
签名验证无效导致的. 在安装 Chrome 完成后删除即可.
2.解决方法:
直接删除,
sudo rm -rf /etc/apt/sources.list.d/google-chrome.list
或者,以备份形式保存,
sudo mv /etc/apt/sources.list.d/google-chrome.list /etc/apt/sources.list.d/google-chrome.list.save
Q&A 4.
1.问题详情:
E: The repository 'http://ppa.launchpad.net/fcitx-team/nightly/ubuntu xenial Release' does not have a Release file.
这是由于 'http://ppa.launchpad.net/fcitx-team/nightly/ubuntu xenial Release'
失效导致的. 在安装 Sogou Pinyin 的时候,可以换源安装,可参考 Ubuntu 16.04 安装搜狗中文输入法安装.
2.解决方法:
直接删除,
sudo rm -f /etc/apt/sources.list.d/fcitx-team-ubuntu-nightly-xenial.list
或者,以备份形式保存,
sudo mv /etc/apt/sources.list.d/fcitx-team-ubuntu-nightly-xenial.list /etc/apt/sources.list.d/fcitx-team-ubuntu-nightly-xenial.list.save