我是 Linux 新手,使用的是 Ubuntu 18.04。每当我尝试 sudo apt-get update 时,我都会收到这些错误:(顺便说一下,我参考了这个链接 -apt-get update 说 E:子进程返回错误代码 ,并尝试了建议,但对我不起作用。请帮我解决这个问题。
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:3 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:4 http://ppa.launchpad.net/kazam-team/stable-series/ubuntu bionic InRelease
Hit:5 http://download.virtualbox.org/virtualbox/debian bionic InRelease
Get:6 https://repo.skype.com/deb stable InRelease [4,502 B]
Hit:7 http://archive.canonical.com/ubuntu bionic InRelease
Hit:8 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:9 https://linux.teamviewer.com/deb stable InRelease
Get:10 http://in.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [1,309 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2,126 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [421 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [294 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,738 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,738 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,738 kB]
Hit:17 http://ppa.launchpad.net/rednotebook/stable/ubuntu bionic InRelease
Hit:18 https://packages.microsoft.com/repos/ms-teams stable InRelease
Hit:19 http://security.ubuntu.com/ubuntu bionic-security InRelease
Err:6 https://repo.skype.com/deb stable InRelease
The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>
Err:14 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
Hash Sum mismatch
Hashes of expected file:
- Filesize:1738296 [weak]
- SHA256:b5b33b5f2f03553cfed3fdc4b49de56337e3478683084543e41c4c454ce33b83
- SHA1:b73196ca99d1b4fc678e0cf813e25afaf9a84b11 [weak]
- MD5Sum:384518af35538afb3103cb07b3c18b71 [weak]
Hashes of received file:
- SHA256:47fc2f4ec9c048bba09b6874b8b4d5602ba5248897a6c349e8b0338be8023929
- SHA1:aff42a04536ae004cf2b5b66eb2f9f112ee13add [weak]
- MD5Sum:b6d999f607cb1426fb1c590a6bc353bb [weak]
- Filesize:1738296 [weak]
Last modification reported: Sat, 26 Jun 2021 00:41:53 +0000
Release file created at: Sat, 26 Jun 2021 00:41:00 +0000
Get:20 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [1,568 kB]
Err:21 http://ppa.launchpad.net/kazam-team/stable-series/ubuntu bionic Release
404 Not Found [IP: 91.189.95.85 80]
Err:20 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages
Hit:23 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease
Get:22 https://packagecloud.io/shiftkey/desktop/any any InRelease [23.2 kB]
Err:22 https://packagecloud.io/shiftkey/desktop/any any InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7E65990E879472F
sh: 1: /usr/lib/cnf-update-db: not found
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://repo.skype.com/deb stable InRelease: The following signatures were invalid: EXPKEYSIG 1F3045A5DF7587C3 Skype Linux Client Repository <[email protected]>
E: The repository 'http://ppa.launchpad.net/kazam-team/stable-series/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: https://packagecloud.io/shiftkey/desktop/any any InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7E65990E879472F
E: The repository 'https://packagecloud.io/shiftkey/desktop/any any InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code
答案1
您必须解决几个问题:
哈希值不匹配可以通过以下方式修复
sudo rm -rf /var/lib/apt/lists/*
Skype GPG 密钥应更新至
sudo apt-key del 1F3045A5DF7587C3 wget https://repo.skype.com/data/SKYPE-GPG-KEY -O - | sudo apt-key add -
卡赞帕没有发布适用于 Ubuntu 18.04 LTS (bionic) 的软件包,因此应通过
sudo apt-get update sudo apt-get install software-properties-common sudo add-apt-repository -r ppa:kazam-team/stable-series
Packagecloud GPG 应该更新
wget https://packagecloud.io/shiftkey/desktop/gpgkey -O - | sudo apt-key add -
损坏
/usr/lib/cnf-update-db
,重新安装sudo apt-get install --reinstall command-not-found sudo apt-get install -f sudo dpkg --configure -a
然后最后运行sudo apt-get update
它就可以工作了。