apt 无法验证签名,无法更新,也无法获取源

apt 无法验证签名,无法更新,也无法获取源

我在台式电脑上运行 Debian。由于某些电缆故障,访问硬盘失败了几次,这导致我的/var文件系统有些损坏。它是一个 btrfs 文件系统。因此,我将整个系统复制到另一个硬盘,但仍然有问题!我不确定它们是否都与文件系统损坏问题有关。

sudo aptitude update
Get: 1 http://ftp.us.debian.org/debian unstable InRelease [209 kB]
Err http://ftp.us.debian.org/debian unstable InRelease
  Unknown error executing apt-key
Fetched 209 kB in 2s (95.9 kB/s)

Current status: 0 (-479) upgradable, 0 (-11) new.
W: GPG error: http://ftp.us.debian.org/debian unstable InRelease: Unknown error executing apt-key
E: The repository 'http://ftp.us.debian.org/debian unstable InRelease' is not signed.

奇怪。apt-get update同样会失败。所以我做了一些测试:

sudo apt-get source hello
Reading package lists... Done
Need to get 733 kB of source archives.
WARNING: The following packages cannot be authenticated!
  hello
E: Some packages could not be authenticated

因此,apt-get它将拒绝获取源,因为它认为它无法检查签名。很有趣。因为apt-get install <whatever-package>它可以工作——除了它会抱怨签名检查:

sudo apt-get install hello
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  hello
0 upgraded, 1 newly installed, 0 to remove and 479 not upgraded.
Need to get 55.7 kB of archives.
After this operation, 545 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  hello
Install these packages without verification? [y/N] y
Get:1 http://ftp.us.debian.org/debian unstable/main amd64 hello amd64 2.10-1 [55.7 kB]
Fetched 55.7 kB in 0s (74.9 kB/s)
Retrieving bug reports... Done
Parsing Found/Fixed information... Done
Selecting previously unselected package hello.
(Reading database ... 851110 files and directories currently installed.)
Preparing to unpack .../hello_2.10-1_amd64.deb ...
Unpacking hello (2.10-1) ...
Processing triggers for install-info (6.1.0.dfsg.1-8) ...
Setting up hello (2.10-1) ...
Processing triggers for man-db (2.7.5-1) ...

所以,我已经跑了

sudo apt-get clean
sudo apt-get --reinstall install apt debian-keyring
sudo dpkg-reconfigure apt debian-keyring

但问题仍然存在。

我终于发现了这个问题:

sudo apt-key net-update
gpg: relocation error: gpg: symbol gcry_sexp_extract_param, version GCRYPT_1.6 not defined in file libgcrypt.so.20 with link time reference

但...

ldd `which apt-key`
        not a dynamic executable

错误报告页面aptdebian-keyringlibgcrypt20没有显示任何似乎与此相关的内容(当然,除非我错过了什么!)

Debian 版本是 sid;我的版本sources.list是这些:

deb http://ftp.us.debian.org/debian/ unstable main non-free contrib
deb-src http://ftp.us.debian.org/debian/ unstable main non-free contrib

apt此外,的版本1.3~rc2与我在另一台运行良好的计算机上的版本相同。

我想知道在真正决定从头开始重新安装系统之前是否还有其他我可以调查的事情(我已经/etc摆弄了 15 年之久,即使我复制/etc到新安装中,恐怕它也不会像看起来那么顺利!)

答案1

尝试这个:

apt-get install gnupg libgcrypt20 -o AllowUnauthenticated=true

或者,当您使用滚动发行版时,最好最近进行一次完整的发行版升级。如果仍然有问题,那么您必须自己填写损坏的新软件包的错误报告。sid 版本用于收集来自众多用户的错误报告。

答案2

我刚刚收到这个错误。不要问我为什么,但运行以下命令即可修复:

$ sudo chmod +r /usr/bin/*

相关内容