无法更新/安装应用程序“不受信任的软件包”

无法更新/安装应用程序“不受信任的软件包”

可能重复:
解决 apt-get BADSIG GPG 错误的最简单方法是什么?

我正在努力让我的 ubuntu 更新/下载任何应用程序,因为它总是显示“需要安装不受信任的软件包”。我在其他帖子中读到该命令应该可以解决问题,但事实并非如此:

sudo apt-get update

这就是结果

aaron@Aaron-Laptop:~$ sudo apt-get update
[sudo] password for aaron: 
Ign http://security.ubuntu.com precise-security InRelease
Ign http://archive.canonical.com precise InRelease                  
Ign http://extras.ubuntu.com precise InRelease                      
Ign http://gb.archive.ubuntu.com precise InRelease                   
Ign http://gb.archive.ubuntu.com precise-updates InRelease           
Hit http://extras.ubuntu.com precise Release.gpg 

[cut a bit out here because it seemed unnecessary?]               

Fetched 69.2 kB in 2min 0s (572 B/s)
Reading package lists... Done
W: GPG error: http://gb.archive.ubuntu.com precise Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]>
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://gb.archive.ubuntu.com precise-updates Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]>

          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/precise-backports/Release.gpg  rename failed, No such file or directory ( -> /var/lib/apt/lists/partial/gb.archive.ubuntu.com_ubuntu_dists_precise-backports_Release.gpg).

W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/precise-updates/Release  

W: Some index files failed to download. They have been ignored, or old ones used instead.
aaron@Aaron-Laptop:~$ 

所以我的问题是,我该怎么做才能解决这个问题?提前谢谢 Aaron

编辑

使用命令 aaron@Aaron-Laptop:~$ sudo apt-get -o Acquire::http::No-Cache=True -o Acquire::BrokenProxy=true update 后

The result i got was :
      W: GPG error: http://mirrors.ccs.neu.edu precise Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]>
W: Conflicting distribution: http://mirrors.ccs.neu.edu precise-updates Release (expected precise-updates but got precise)
W: GPG error: http://mirrors.ccs.neu.edu precise-security Release: Unknown error executing gpgv
W: Failed to fetch http://mirrors.ccs.neu.edu/ubuntu/dists/precise-security/Release.gpg  rename failed, No such file or directory ( -> /var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-security_Release.gpg).

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_main_source_Sources  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_restricted_source_Sources  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_universe_source_Sources  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_multiverse_source_Sources  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_main_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_restricted_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_universe_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_multiverse_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_main_binary-i386_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_restricted_binary-i386_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_universe_binary-i386_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_multiverse_binary-i386_Packages  Hash Sum mismatch

E : Some index files failed to download. They have been ignored, or old ones used instead.

和另一个

aaron@Aaron-Laptop:~$ apt-key list
gpg: fatal: /home/aaron/.gnupg: directory does not exist!
secmem usage: 0/0 bytes in 0/0 blocks of pool 0/32768
aaron@Aaron-Laptop:~$ 

认为这就是你想要的:

aaron@Aaron-Laptop:~$ apt-key list
gpg: fatal: /home/aaron/.gnupg: directory does not exist!
secmem usage: 0/0 bytes in 0/0 blocks of pool 0/32768
aaron@Aaron-Laptop:~$ ls -al /etc/apt/trusted.gpg*
-rw-r--r-- 1 root root 18402 Jan 28 19:10 /etc/apt/trusted.gpg
-rw-r--r-- 1 root root 19835 Jan 28 18:39 /etc/apt/trusted.gpg~

/etc/apt/trusted.gpg.d:
total 8
drwxr-xr-x 2 root root 4096 Apr 20  2012 .
drwxr-xr-x 6 root root 4096 Jan 28 19:10 ..

aaron@Aaron-Laptop:~$ apt-key --keyring /etc/apt/trusted.gpg list
gpg: fatal: /home/aaron/.gnupg: directory does not exist!
secmem usage: 0/0 bytes in 0/0 blocks of pool 0/32768
aaron@Aaron-Laptop:~$ 

我输入了您告诉我的命令:

    aaron@Aaron-Laptop:~$ gpg --keyserver pgpkeys.mit.edu --recv-key 40976EAF C0B21F32 3E5C1192 # 2004, 2012 and extras key
   gpg: requesting key 40976EAF from hkp server pgpkeys.mit.edu
   gpg: requesting key C0B21F32 from hkp server pgpkeys.mit.edu
   gpg: requesting key 3E5C1192 from hkp server pgpkeys.mit.edu
   gpgkeys: key 40976EAF not found on keyserver
   gpg: key C0B21F32: "Ubuntu Archive Automatic Signing Key (2012) <[email protected]>" not changed
   gpg: key 3E5C1192: "Ubuntu Extras Archive Automatic Signing Key <[email protected]>" not changed
   gpg: Total number processed: 2
   gpg:              unchanged: 2
   aaron@Aaron-Laptop:~$ gpg -a --export 40976EAF | sudo apt-key add -
   gpg: no valid OpenPGP data found.
   aaron@Aaron-Laptop:~$ gpg -a --export C0B21F32 | sudo apt-key add -
    OK
   aaron@Aaron-Laptop:~$ gpg -a --export 3E5C1192 | sudo apt-key add -
    OK
   aaron@Aaron-Laptop:~$ 

我现在应该运行“sudo apt-get update”吗?或者我应该先做其他什么吗?

好的,做了新的事情然后进行了更新并得到了这个:

W: GPG error: http://mirrors.ccs.neu.edu precise Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <[email protected]>
W: Conflicting distribution: http://mirrors.ccs.neu.edu precise-updates Release (expected precise-updates but got precise)
W: GPG error: http://mirrors.ccs.neu.edu precise-security Release: Unknown error executing gpgv
W: Failed to fetch http://mirrors.ccs.neu.edu/ubuntu/dists/precise-backports/Release.gpg  rename failed, No such file or directory ( -> /var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-backports_Release.gpg).

W: Failed to fetch http://mirrors.ccs.neu.edu/ubuntu/dists/precise-security/Release.gpg  rename failed, No such file or directory ( -> /var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-security_Release.gpg).

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_main_source_Sources  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_restricted_source_Sources  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_universe_source_Sources  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_multiverse_source_Sources  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_main_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_restricted_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_universe_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_multiverse_binary-amd64_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_main_binary-i386_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_restricted_binary-i386_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_universe_binary-i386_Packages  Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/mirrors.ccs.neu.edu_ubuntu_dists_precise-updates_multiverse_binary-i386_Packages  Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

有任何想法吗? :/

答案1

/etc/apt/trusted.gpg文件应该可以被 Ubuntu 读取apt-key,并包含一组公钥。就你的情况而言,这似乎是不可读的。你的系统如何最终处于这种状态本身就是一个问题,但绝不应该发生。

要重新创建一组密钥,您可以尝试以下操作:

gpg --keyserver pgpkeys.mit.edu --recv-key 437D05B5 C0B21F32 3E5C1192 # 2004, 2012 and extras key
gpg -a --export 437D05B5 | sudo apt-key add -
gpg -a --export C0B21F32 | sudo apt-key add -
gpg -a --export 3E5C1192 | sudo apt-key add -

然后运行

sudo apt-get update

其运行时应该不会出现之前遇到的错误。

相关内容