无法完成 apt 更新 | Ubuntu 20.04 中的 GPG 错误

无法完成 apt 更新 | Ubuntu 20.04 中的 GPG 错误

有一天我决定这样做apt update,结果收到了以下错误消息。我尝试用谷歌搜索并尝试了一些修复方法,但没有成功。想知道是否有人之前处理过这个问题或知道修复方法?

这里apt update输出:

root@whmcs:/home/peter# apt update -y Hit:1
http://archive.ubuntu.com/ubuntu focal InRelease Hit:2
http://archive.ubuntu.com/ubuntu focal-updates InRelease Hit:3
http://archive.ubuntu.com/ubuntu focal-backports InRelease Get:4
http://security.archive.ubuntu.com/ubuntu precise-security InRelease
[55.7                                                                 
kB] Hit:5 http://archive.ubuntu.com/ubuntu focal-security InRelease
Err:4 http://security.archive.ubuntu.com/ubuntu precise-security
InRelease   The following signatures couldn't be verified because the
public key is not av                                                  
ailable: NO_PUBKEY 40976EAF437D05B5 Reading package lists... Done W:
GPG error: http://security.archive.ubuntu.com/ubuntu precise-security
InRelea                                                               
se: The following signatures couldn't be verified because the public
key is not                                                            
available: NO_PUBKEY 40976EAF437D05B5 E: The repository
'http://security.archive.ubuntu.com/ubuntu precise-security In        
Release' is not signed. N: Updating from such a repository can't be
done securely, and is therefore disa                                  
bled by default. N: See apt-secure(8) manpage for repository creation
and user configuration deta                                           
ils. root@whmcs:/home/peter# apt-key adv --keyserver
keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 Executing:
/tmp/apt-key-gpghome.1URdR73Goe/gpg.1.sh --keyserver
keyserver.ubuntu.com --recv-keys 40976EAF437D05B5 gpg: key
40976EAF437D05B5: public key "Ubuntu Archive Automatic Signing Key
<[email protected]>" imported gpg: Total number processed: 1 gpg:  
imported: 1 root@whmcs:/home/peter# apt-key adv --keyserver
keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 Executing:
/tmp/apt-key-gpghome.T4gCTfqOmG/gpg.1.sh --keyserver
keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32 gpg: key
3B4FE6ACC0B21F32: "Ubuntu Archive Automatic Signing Key (2012)
<[email protected]>" not changed gpg: Total number processed: 1
gpg:              unchanged: 1 root@whmcs:/home/peter# apt update -y
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease Get:2
http://security.archive.ubuntu.com/ubuntu precise-security InRelease
[55.7 kB] Hit:3 http://archive.ubuntu.com/ubuntu focal-updates
InRelease Hit:4 http://archive.ubuntu.com/ubuntu focal-backports
InRelease Hit:5 http://archive.ubuntu.com/ubuntu focal-security
InRelease Err:2 http://security.archive.ubuntu.com/ubuntu
precise-security InRelease   The following signatures were invalid:
630239CC130E1A7FD81A27B140976EAF437D05B5 Reading package lists... Done
W: GPG error: http://security.archive.ubuntu.com/ubuntu
precise-security InRelease: The following signatures were invalid:
630239CC130E1A7FD81A27B140976EAF437D05B5 E: The repository
'http://security.archive.ubuntu.com/ubuntu precise-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.
root@whmcs:/home/peter# apt-key adv --keyserver keyserver.ubuntu.com
--recv-keys 9578539176BAFBC6 Executing: /tmp/apt-key-gpghome.QLkAQKfS0L/gpg.1.sh --keyserver
keyserver.ubuntu.com --recv-keys 9578539176BAFBC6 gpg: key
9578539176BAFBC6: public key "Launchpad PPA for Peek Developers"
imported gpg: Total number processed: 1 gpg:               imported: 1
root@whmcs:/home/peter# apt update -y Hit:1
http://archive.ubuntu.com/ubuntu focal InRelease Hit:2
http://archive.ubuntu.com/ubuntu focal-updates InRelease Get:3
http://security.archive.ubuntu.com/ubuntu precise-security InRelease
[55.7 kB] Hit:4 http://archive.ubuntu.com/ubuntu focal-backports
InRelease Hit:5 http://archive.ubuntu.com/ubuntu focal-security
InRelease Err:3 http://security.archive.ubuntu.com/ubuntu
precise-security InRelease   The following signatures were invalid:
630239CC130E1A7FD81A27B140976EAF437D05B5 Reading package lists... Done
W: GPG error: http://security.archive.ubuntu.com/ubuntu
precise-security InRelease: The following signatures were invalid:
630239CC130E1A7FD81A27B140976EAF437D05B5 E: The repository
'http://security.archive.ubuntu.com/ubuntu precise-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.
root@whmcs:/home/peter# apt-key list /etc/apt/trusted.gpg
-------------------- pub   dsa1024 2004-09-12 [SC]
      6302 39CC 130E 1A7F D81A  27B1 4097 6EAF 437D 05B5 uid           [ unknown] Ubuntu Archive Automatic Signing Key <[email protected]>
sub   elg2048 2004-09-12 [E]

pub   rsa4096 2017-02-14 [SC]
      8C95 3129 9E7D F2DC F681  B499 9578 5391 76BA FBC6 uid           [ unknown] Launchpad PPA for Peek Developers

/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-archive.gpg
------------------------------------------------------ pub   rsa4096 2012-05-11 [SC]
      790B C727 7767 219C 42C8  6F93 3B4F E6AC C0B2 1F32 uid           [ unknown] Ubuntu Archive Automatic Signing Key (2012)
<[email protected]>

/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg
------------------------------------------------------ pub   rsa4096 2012-05-11 [SC]
      8439 38DF 228D 22F7 B374  2BC0 D94A A3F0 EFE2 1092 uid           [ unknown] Ubuntu CD Image Automatic Signing Key (2012)
<[email protected]>

/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg
------------------------------------------------------ pub   rsa4096 2018-09-17 [SC]
      F6EC B376 2474 EDA9 D21B  7022 8719 20D1 991B C93C uid           [ unknown] Ubuntu Archive Automatic Signing Key (2018)
<[email protected]>

root@whmcs:/home/peter# apt-key adv --keyserver
hkp://keyserver.ubuntu.com:80 --recv-keys 6494C6D6997C215E Executing:
/tmp/apt-key-gpghome.3F0Y0BBMXD/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80 --recv-keys 6494C6D6997C215E gpg: key
7721F63BD38B4796: public key "Google Inc. (Linux Packages Signing
Authority) <[email protected]>" imported gpg: Total
number processed: 1 gpg:               imported: 1
root@whmcs:/home/peter# apt update -y Hit:1
http://archive.ubuntu.com/ubuntu focal InRelease Hit:2
http://archive.ubuntu.com/ubuntu focal-updates InRelease Hit:3
http://archive.ubuntu.com/ubuntu focal-backports InRelease Get:4
http://security.archive.ubuntu.com/ubuntu precise-security InRelease
[55.7 kB] Hit:5 http://archive.ubuntu.com/ubuntu focal-security
InRelease Err:4 http://security.archive.ubuntu.com/ubuntu
precise-security InRelease   The following signatures were invalid:
630239CC130E1A7FD81A27B140976EAF437D05B5 Reading package lists... Done
W: GPG error: http://security.archive.ubuntu.com/ubuntu
precise-security InRelease: The following signatures were invalid:
630239CC130E1A7FD81A27B140976EAF437D05B5 E: The repository
'http://security.archive.ubuntu.com/ubuntu precise-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.
root@whmcs:/home/peter# apt-key adv --keyserver
hkp://security.archive.ubuntu.com:80 --recv-keys
630239CC130E1A7FD81A27B140976EAF437D05B5 Executing:
/tmp/apt-key-gpghome.LGIp7XpAwt/gpg.1.sh --keyserver
hkp://security.archive.ubuntu.com:80 --recv-keys
630239CC130E1A7FD81A27B140976EAF437D05B5 gpg: keyserver receive
failed: No data root@whmcs:/home/peter# apt-key adv --keyserver
hkp://security.archive.ubuntu.com:80/ubuntu --recv-keys
630239CC130E1A7FD81A27B140976EAF437D05B5 Executing:
/tmp/apt-key-gpghome.7Wjf8X1sYL/gpg.1.sh --keyserver
hkp://security.archive.ubuntu.com:80/ubuntu --recv-keys
630239CC130E1A7FD81A27B140976EAF437D05B5 gpg: keyserver receive
failed: No data root@whmcs:/home/peter# apt-key adv --keyserver
security.archive.ubuntu.com --recv-keys
630239CC130E1A7FD81A27B140976EAF437D05B5 Executing:
/tmp/apt-key-gpghome.8rDoRoC9Pf/gpg.1.sh --keyserver
security.archive.ubuntu.com --recv-keys
630239CC130E1A7FD81A27B140976EAF437D05B5 gpg: keyserver receive
failed: Connection refused root@whmcs:/home/peter# apt-key adv
--keyserver http://security.archive.ubuntu.com/ubuntu --recv-keys 630239CC130E1A7FD81A27B140976EAF437D05B5 Executing:
/tmp/apt-key-gpghome.DZvJQ6GQHn/gpg.1.sh --keyserver
http://security.archive.ubuntu.com/ubuntu --recv-keys
630239CC130E1A7FD81A27B140976EAF437D05B5 gpg: no valid OpenPGP data
found. gpg: Total number processed: 0 root@whmcs:/home/peter# lsdb_a
lsdb_a: command not found root@whmcs:/home/peter# lsb_release -s No
LSB modules are available. root@whmcs:/home/peter# lsb_release -a No
LSB modules are available. Distributor ID: Ubuntu Description:   
Ubuntu 20.04.2 LTS Release:        20.04 Codename:       focal
root@whmcs:/home/peter#

答案1

不建议混合 Ubuntu 版本存储库。

sources.list 中的以下行是问题的根本原因:

http://security.archive.ubuntu.com/ubuntu precise-security main

precise从您的/etc/apt/sources.list或中删除存储库/etc/apt/sources.list.d/

要获取名称文件并显示其内容,请使用:

grep -Rn --include=\*.list ^[^\#] /etc/apt/

相关内容