删除过时的存储库sources.list

删除过时的存储库sources.list

我使用了这里给出的所有答案:“GPG 错误:发布:以下签名无效:BADSIG”

但我仍然每次都会遇到同样的错误:

Reading package lists... Done
W: GPG error: http://archive.canonical.com precise Release:
 The following signatures were invalid: 630239CC130E1A7FD81A27B140976EAF437D05B5
E: The repository 'http://archive.canonical.com precise Release' 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.

第一次尝试:

ahadji05@ahadji05-UX330UAR:~$ gpg --keyserver keyserver.ubuntu.com --recv-keys 16126D3A3E5C1192
gpg: key 16126D3A3E5C1192: 3 signatures not checked due to missing keys
gpg: key 16126D3A3E5C1192: public key "Ubuntu Extras Archive Automatic 
Signing Key <[email protected]>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1

ahadji05@ahadji05-UX330UAR:~$ gpg --export --armor 16126D3A3E5C1192 | sudo apt-key add -
OK

ahadji05@ahadji05-UX330UAR:~$ sudo apt-get update
Ign:1 http//archive.canonical.com precise InRelease
Hit:2 http//security.ubuntu.com/ubuntu bionic-security InRelease             
Reading package lists... Done  
W: GPG error: http://archive.canonical.com precise Release:
  The following signatures were invalid: 630239CC130E1A7FD81A27B140976EAF437D05B5
E: The repository 'http://archive.canonical.com precise Release' 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.

然后我尝试了这个:

ahadji05@ahadji05-UX330UAR:~$ sudo -i
root@ahadji05-UX330UAR:~# apt-get clean
root@ahadji05-UX330UAR:~# cd /var/lib/apt
root@ahadji05-UX330UAR:/var/lib/apt# mv lists lists.old
root@ahadji05-UX330UAR:/var/lib/apt# mkdir -p lists/partial
root@ahadji05-UX330UAR:/var/lib/apt# apt-get clean
root@ahadji05-UX330UAR:/var/lib/apt# apt-get update
Ign:1 http//archive.canonical.com precise InRelease
Get:2 http//sd.archive.ubuntu.com/ubuntu bionic InRelease [242 kB]                                        
Get:3 http//archive.canonical.com precise Release [8,180 B]                                               
Get:4 http//archive.canonical.com precise Release.gpg [181 B]                                                        
Get:5 http//security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                           
Get:6 http//sd.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]          
Ign:4 http//archive.canonical.com precise Release.gpg         
........
Get:70 http//sd.archive.ubuntu.com/ubuntu bionic-backports/universe translation-en [1,604 B]                                                                                                              
Get:71 http//sd.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [7,352 B]                                                                                                       
Get:72 http//sd.archive.ubuntu.com/ubuntu bionic-backports/universe DEP-11 48x48 Icons [29 B]                                                                                                             
Get:73 http//sd.archive.ubuntu.com/ubuntu bionic-backports/universe DEP-11 64x64 Icons [29 B]                                                                                                             
Reading package lists... Done                                                                                                                                                                              
W: GPG error: http//archive.canonical.com precise Release:
 The following signatures were invalid: 630239CC130E1A7FD81A27B140976EAF437D05B5
E: The repository 'http//archive.canonical.com precise Release' 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.

最后是这个:

ahadji05@ahadji05-UX330UAR:~$ sudo apt-get clean
ahadji05@ahadji05-UX330UAR:~$ sudo mv /var/lib/apt/lists /tmp
ahadji05@ahadji05-UX330UAR:~$ sudo mkdir -p /var/lib/apt/lists/partial
ahadji05@ahadji05-UX330UAR:~$ sudo apt-get clean
ahadji05@ahadji05-UX330UAR:~$ sudo apt-get update
Ign:1 http//archive.canonical.com precise InRelease
Get:2 http//sd.archive.ubuntu.com/ubuntu bionic InRelease [242 kB]        
Get:3 http//archive.canonical.com precise Release [8,180 B]                                               
Get:4 http//archive.canonical.com precise Release.gpg [181 B]                                                       
Ign:4 http//archive.canonical.com precise Release.gpg                                    
Get:5 http//security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]           
Get:6 http//sd.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]       
Get:7 http//sd.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                 
Get:8 http//sd.archive.ubuntu.com/ubuntu bionic/main i386 Packages [1,007 kB]                 
Get:9 http//sd.archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1,019 kB]                 
Get:10 http//security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [269 kB]
Get:11 http//sd.archive.ubuntu.com/ubuntu bionic/main Translation-en [516 kB]  
.......
Get:72 http//sd.archive.ubuntu.com/ubuntu bionic-backports/universe DEP-11 48x48 Icons [29 B]                                                                                                             
Get:73 http//sd.archive.ubuntu.com/ubuntu bionic-backports/universe DEP-11 64x64 Icons [29 B]                                                                                                             
Reading package lists... Done                                                                                                                                                                              
W: GPG error: http//archive.canonical.com precise Release:
 The following signatures were invalid: 630239CC130E1A7FD81A27B140976EAF437D05B5
E: The repository 'http//archive.canonical.com precise Release' 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.

在所有情况下我都遇到了同样的错误......

答案1

删除过时的存储库sources.list

这个问题与 Ubuntu 18.04 Bionic 有关。原作者错误地添加了 Ubuntu 12.04 Precise 的过时存储库,该存储库已过期。此过时存储库已不存在,并导致错误:

E: The repository 'http//archive.canonical.com precise Release' is not signed. 

解决方案是从中删除有问题的行sources.list

GUI 方法:

打开“软件和更新”程序

在此处输入图片描述

然后转到其他软件选项卡:

在此处输入图片描述

查找每一行精确的在其上。一次突出显示一行。按下Remove窗口底部的按钮。

对所有行重复精确的在上面。这些行指的是 Ubuntu 12.04 的过时存储库。您正在使用 Ubuntu 18.04,这是当前支持的版本之一。

命令行方法:

Ctrl++打开终端并输入:AltT

sudo nano /etc/apt/sources.list

现在您就可以编辑该sources.list文件了。查找以下行:

deb http://archive.ubuntu.com/ubuntu precise Release

删除此行以及任何其他行精确的在里面。

nanoCtrl+退出编辑器X。编辑器将提示您保存更改。按Y然后Enter按 选择默认文件名。

希望这可以帮助

相关内容