我尝试更新我的包裹列表时遇到的错误。
W: GPG error: http://download.opensuse.org ./ Release: The following signatures were invalid: KEYEXPIRED 1436387333
W: Failed to fetch http://ppa.launchpad.net/samrog131/ppa/ubuntu/dists/trusty/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
答案1
我没有得到上述答案,我的系统时钟很好。以下方法对我有用:
sudo apt-key list | grep "expired: "
sudo apt-key adv --keyserver keys.gnupg.net --recv-keys [KEY]
关键在于斜线后面的部分:0000X/<this part is the key>
或者使用这个:
sudo apt-key list | grep "expired: " | sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' | xargs -n1 sudo apt-key adv --keyserver keys.gnupg.net --recv-keys
答案2
就像这样简单:
sudo apt-key adv --refresh-keys
如果可以自行对事物进行排序,sed
那为什么要使用呢?xargs
gpg
如果收到有关无法访问密钥服务器的错误,请尝试直接设置一个:
sudo apt-key adv --keyserver keyserver.ubuntu.com --refresh-keys
答案3
GPG error: http://download.opensuse.org ./ Release: The following signatures were invalid: KEYEXPIRED 1436387333
这说明该存储库的 GPG 密钥已过期,这意味着两种情况之一:要么您的系统的日期错误,要么密钥确实已过期。对于后者,您需要联系存储库维护者并导入新密钥(可能删除旧的),一旦存储库更新其密钥来对文件进行签名。
如果您没有使用这些存储库的软件包,则可以放心地忽略这些消息。如果您从source.list
文件/目录中删除存储库,则可以删除该消息。
答案4
这些都不适合我:
$ sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 5072E1F5
或者
$ sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5
或者
$ sudo apt-key adv --keyserver pgp.mit.edu --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
这些来源如下: https://bugs.mysql.com/bug.php?id=85029和https://bugs.mysql.com/bug.php?id=94378
我绝望地进行了一项可疑操作(下面将“N”写成“y”),我认为这根本没有必要:
$ sudo apt-get install mysql-apt-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
mysql-apt-config
1 upgraded, 0 newly installed, 0 to remove and 294 not upgraded.
Need to get 35.6 kB of archives.
After this operation, 0 B of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
mysql-apt-config
Install these packages without verification? [y/N] y
Get:1 http://repo.mysql.com/apt/ubuntu/ trusty/mysql-apt-config mysql-apt-config all 0.8.13-1 [35.6 kB]
Fetched 35.6 kB in 0s (229 kB/s)
Preconfiguring packages ...
dpkg-deb: error: archive '/var/cache/apt/archives/mysql-apt-config_0.8.13-1_all.deb' has premature member 'control.tar.xz' before 'contro
l.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/mysql-apt-config_0.8.13-1_all.deb (--unpack):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/mysql-apt-config_0.8.13-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
接下来是:
$ sudo apt-get update
这没有帮助。
我仍然遇到同样的错误。
最后,以下有效:
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 5072E1F5
我(盲目地)猜测,也许 pgp.mit.edu 已经改变了它们的结构,或者“MySQL Release Engineering”(运行apt-key list
)已经将它们的密钥移到了 ubuntu 密钥服务器或者类似的东西(我不知道密钥是如何维护的)。
这重复线程上的评论说了同样的事情。
希望这可以为某些人节省一些时间和精力。