无法更新 Ubuntu 18.04

无法更新 Ubuntu 18.04

当我运行命令时:root@versinator:~# apt-get update 出现以下错误:

Hit:1 http://us-east1.gce.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://us-east1.gce.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://us-east1.gce.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://archive.canonical.com/ubuntu bionic InRelease
Hit:6 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:7 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu bionic InRelease
Get:5 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial InRelease [17.5 kB]
Err:5 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1E9377A2BA9EF27F
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1E9377A2BA9EF27F
E: The repository 'http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial InRelease' 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

“apt-get update”的问题在于您缺少公钥 1E9377A2BA9EF27F。您可以通过执行以下命令将此密钥添加到您的密钥环中:

sudo apt-key adv --recv-key 1E9377A2BA9EF27F

它将显示类似以下内容的内容:

Executing: /tmp/apt-key-gpghome.IA65nrxcnz/gpg.1.sh --recv-key 1E9377A2BA9EF27F
gpg: key 1E9377A2BA9EF27F: public key "Launchpad Toolchain builds" imported
gpg: Total number processed: 1
gpg:               imported: 1

现在您可以运行“apt-get update”或“apt update”,它将获取“http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntuxenial InRelease” 也是如此。

答案2

转到 synaptic,然后转到设置选项卡存储库,然后转到其他软件。取消选中 Ubuntu-toolchain-r 的 ppa 前面的框。重新加载。

答案3

编辑文件:

sudo nano /etc/apt/sources.list

将 # 作为该行的第一个字符。

然后,只需进行更新:

sudo apt update

如果错误消失,您可以删除标记的行。

相关内容