sudo apt-get update错误解决方案

错误现象

fappy@fappy-Inspiron-3670:~$ sudo apt-get update
[sudo] password for fappy: 
Hit:1 http://packages.microsoft.com/repos/code stable InRelease
Hit:2 http://mirrors.bwbot.org stable InRelease        
Ign:3 http://cn.archive.ubuntu.com/ubuntu groovy InRelease
Ign:4 http://cn.archive.ubuntu.com/ubuntu groovy-updates InRelease
Ign:5 http://cn.archive.ubuntu.com/ubuntu groovy-backports InRelease
Ign:6 http://cn.archive.ubuntu.com/ubuntu groovy-security InRelease
Ign:7 http://cn.archive.ubuntu.com/ubuntu groovy-proposed InRelease
Err:8 http://cn.archive.ubuntu.com/ubuntu groovy Release
  404  Not Found [IP: 91.189.91.39 80]
Err:9 http://cn.archive.ubuntu.com/ubuntu groovy-updates Release
  404  Not Found [IP: 91.189.91.39 80]
Err:10 http://cn.archive.ubuntu.com/ubuntu groovy-backports Release
  404  Not Found [IP: 91.189.91.39 80]
Err:11 http://cn.archive.ubuntu.com/ubuntu groovy-security Release
  404  Not Found [IP: 91.189.91.39 80]
Err:12 http://cn.archive.ubuntu.com/ubuntu groovy-proposed Release
  404  Not Found [IP: 91.189.91.39 80]
Reading package lists... Done
E: The repository 'http://cn.archive.ubuntu.com/ubuntu groovy Release' no longer has 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.
E: The repository 'http://cn.archive.ubuntu.com/ubuntu groovy-updates Release' no longer has 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.
E: The repository 'http://cn.archive.ubuntu.com/ubuntu groovy-backports Release' no longer has 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.
E: The repository 'http://cn.archive.ubuntu.com/ubuntu groovy-security Release' no longer has 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.
E: The repository 'http://cn.archive.ubuntu.com/ubuntu groovy-proposed Release' no longer has 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: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target DEP-11 (restricted/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target DEP-11-icons-small (restricted/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target DEP-11-icons-hidpi (restricted/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:5 and /etc/apt/sources.list:59
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target DEP-11 (multiverse/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target DEP-11 (multiverse/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target DEP-11-icons-small (multiverse/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target DEP-11-icons (multiverse/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target DEP-11-icons-hidpi (multiverse/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:26 and /etc/apt/sources.list:59
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target DEP-11 (restricted/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target DEP-11-icons-small (restricted/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target DEP-11-icons-hidpi (restricted/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list:61
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target DEP-11 (multiverse/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target DEP-11 (multiverse/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target DEP-11-icons-small (multiverse/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target DEP-11-icons (multiverse/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target DEP-11-icons-hidpi (multiverse/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:28 and /etc/apt/sources.list:61
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target DEP-11 (restricted/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target DEP-11-icons-small (restricted/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target DEP-11-icons-hidpi (restricted/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target DEP-11 (multiverse/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target DEP-11 (multiverse/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target DEP-11-icons-small (multiverse/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target DEP-11-icons (multiverse/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target DEP-11-icons-hidpi (multiverse/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:36 and /etc/apt/sources.list:62
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target DEP-11 (restricted/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target DEP-11-icons-small (restricted/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target DEP-11-icons-hidpi (restricted/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:60
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target DEP-11 (multiverse/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target DEP-11 (multiverse/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target DEP-11-icons-small (multiverse/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target DEP-11-icons (multiverse/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target DEP-11-icons-hidpi (multiverse/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60
W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60

两个错误

源地址重复

W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:60

从错误信息就可以看出来,是/etc/apt/sources.list中的50行与60行配置了重复的两个地址。

随便注释其中一个即可

版本号没有找到

Err:8 http://cn.archive.ubuntu.com/ubuntu groovy Release
404 Not Found [IP: 91.189.91.39 80]

从http://cn.archive.ubuntu.com/ubuntu地址可以看到,如下图:

请添加图片描述

其中并没有groovy的版本号,所以替换为其中的一个可以解决

但在替换成bionic的时候,出现

Hit:1 http://packages.microsoft.com/repos/code stable InRelease
Get:2 http://mirrors.aliyun.com/ubuntu bionic InRelease [242 kB]
Hit:3 http://mirrors.bwbot.org stable InRelease         
Get:4 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease [88.7 kB]
Err:2 http://mirrors.aliyun.com/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Get:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease [74.6 kB]
Err:4 http://mirrors.aliyun.com/ubuntu bionic-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Get:6 http://mirrors.aliyun.com/ubuntu bionic-security InRelease [88.7 kB]
Err:5 http://mirrors.aliyun.com/ubuntu bionic-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Err:6 http://mirrors.aliyun.com/ubuntu bionic-security InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Get:7 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease [242 kB]
Err:7 http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Reading package lists... Done
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic 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.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-updates 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.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-backports 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.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-security 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.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-proposed 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.

换成jammy版本号即可!


版权声明:本文为qq_39021670原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。