无法安装 R 更新,因为它们“需要安装不受信任的软件包”,也无法更新过期密钥(Ubuntu 16.04 LTS)

无法安装 R 更新,因为它们“需要安装不受信任的软件包”,也无法更新过期密钥(Ubuntu 16.04 LTS)

这个问题我已经遇到一段时间了。首先,我尝试通过软件更新程序更新我的软件。除了 R(开源统计软件)软件包之外,我成功更新了所有软件包。我收到以下错误消息,指出

这需要从未经认证的来源安装软件包。

然后我尝试通过终端更新软件包:

sudo apt-get update

它不起作用。

Hit:2 http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu xenial InRelease     
Ign:3 http://dell.archive.canonical.com/updates xenial-dell-service InRelease  
Hit:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease                
Hit:5 http://dl.google.com/linux/chrome/deb stable InRelease                   
Ign:6 http://dell.archive.canonical.com/updates xenial-dell-turis-vegas-mlk-kbl InRelease
Hit:7 http://archive.ubuntu.com/ubuntu xenial-backports InRelease              
Hit:8 http://ppa.launchpad.net/codeblocks-devs/release/ubuntu xenial InRelease 
Hit:9 http://archive.canonical.com/ubuntu xenial InRelease                     
Hit:10 http://dell.archive.canonical.com/updates xenial-dell InRelease         
Hit:11 http://dell.archive.canonical.com/updates xenial-dell-service Release   
Hit:12 http://security.ubuntu.com/ubuntu xenial-security InRelease             
Hit:13 http://ppa.launchpad.net/nathan-renniewaldock/flux/ubuntu xenial InRelease
Hit:14 http://dell.archive.canonical.com/updates xenial-dell-turis-vegas-mlk-kbl Release
Get:15 https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ InRelease [3625 B]
Ign:15 https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ InRelease
Fetched 3625 B in 0s (4471 B/s)
Reading package lists... Done
W: GPG error: https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ InRelease: The following signatures were invalid: KEYEXPIRED 1602869253  KEYEXPIRED 1602869253  KEYEXPIRED 1602869253
W: The repository 'https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/ InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.```


I looked around the web for an answer and I found out that most likely the key has expired so I checked:

```apt-key list|grep "expired:"```

This is the output I got:

```pub   2048R/E084DAB9 2010-10-19 [expired: 2020-10-16]```

Then I tried to renew the expired key:

```gpg --keyserver keys.gnupg.net --recv E084DAB9```

```gpg: requesting key E084DAB9 from hkp server keys.gnupg.net
?: keys.gnupg.net: Host not found
gpgkeys: HTTP fetch error 7: couldn't connect: Success
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0
gpg: keyserver communications error: keyserver unreachable
gpg: keyserver communications error: public key not found
gpg: keyserver receive failed: public key not found```

Nothing happened, so I tried again with another keyserver:

```gpg --keyserver keyserver.ubuntu.com --recv E084DAB9```

```gpg: requesting key E084DAB9 from hkp server keyserver.ubuntu.com
gpg: /home/mainuser/.gnupg/trustdb.gpg: trustdb created
gpg: key E084DAB9: public key "Totally Legit Signing Key <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)```

Then I tried ```sudo apt-get update``` again, and got the same error from before. 

Has anyone had the same problem? I have run out of ideas how to fix the expired key issue.

-----------------------

Update - tried this as well 

```gpg --export --armor E084DAB9 | sudo apt-key add - ``` (from askubuntu.com/questions/117015/…), still can't install updates. 

Tried ```sudo apt-get install --allow-unauthenticated exiv2``` as well, no difference.

答案1

你必须安全适配经过

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

或者

gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | sudo apt-key add -

然后用 重试sudo apt-get update

文档解释了这一点这里

相关内容