解决apt update执行时因签名而运行失败的问题

家里的台式机吃灰很久了,担心坏掉,近期花了点时间重新插好线,晚上下班用来查查资料,写写笔记。

当前主要使用ubuntu系统,近期更新软件包时,发现总是会报错,如下:

shell 复制代码
$ sudo apt-get update
[sudo] password for jackie:
Get:1 http://dl.google.com/linux/chrome/deb stable InRelease [1,825 B]
Hit:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease
Get:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease [114 kB]
Get:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease [108 kB]
Get:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security InRelease [114 kB]
Err:1 http://dl.google.com/linux/chrome/deb stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
Get:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 DEP-11 Metadata [275 kB]
Get:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe amd64 DEP-11 Metadata [414 kB]
Get:8 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [944 B]
Get:9 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main amd64 DEP-11 Metadata [7,956 B]
Get:10 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.5 kB]
Get:11 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main amd64 DEP-11 Metadata [59.8 kB]
Get:12 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe amd64 DEP-11 Metadata [96.5 kB]
Get:13 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [940 B]
Fetched 1,221 kB in 1s (935 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://dl.google.com/linux/chrome/deb stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4EB27DB2A3B88B8B
W: Some index files failed to download. They have been ignored, or old ones used instead.

经过搜索,发现报错信息和/etc/apt/sources.list.d/google-chrome.list中的配置相关,如下:

shell 复制代码
$ cat /etc/apt/sources.list.d/google-chrome.list
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main

参考网友的帖子,在命令行执行如下命令。注意4EB27DB2A3B88B8B来自于前述报错信息。

shell 复制代码
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
Executing: /tmp/apt-key-gpghome.PLpUkfs0hN/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
gpg: key 7721F63BD38B4796: 2 duplicate signatures removed
gpg: key 7721F63BD38B4796: "Google Inc. (Linux Packages Signing Authority) <linux-packages-keymaster@google.com>" 3 new signatures
gpg: key 7721F63BD38B4796: "Google Inc. (Linux Packages Signing Authority) <linux-packages-keymaster@google.com>" 2 new subkeys
gpg: Total number processed: 1
gpg:            new subkeys: 2
gpg:         new signatures: 3

此时再次执行更新操作,报错信息消失,命令成功执行结束,如下:

shell 复制代码
$ sudo apt-get update
Get:1 http://dl.google.com/linux/chrome/deb stable InRelease [1,825 B]
Hit:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease
Hit:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease
Hit:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease
Hit:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security InRelease
Get:6 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,079 B]
Fetched 1,079 B in 1s (1,299 B/s)
Reading package lists... Done

世界又美好了。

相关推荐
果粒陈爱写代码2 分钟前
Linux day 11 28
linux·运维·服务器
myNameGL19 分钟前
Linux SVN下载安装配置客户端
linux·运维·svn
WongKyunban41 分钟前
向bash shell脚本传参
linux·开发语言·bash
chian-ocean1 小时前
Linux环境变量:系统的隐形纽带
linux·运维·服务器
PigeonGuan1 小时前
[Linux] 服务器CPU信息
java·linux·服务器
乐大师1 小时前
Dell服务器升级ubuntu 22.04失败解决
运维·服务器·ubuntu
蜜獾云2 小时前
linux tar 文件解压压缩
linux·运维·服务器·tar
vvw&3 小时前
如何在 Ubuntu 22.04 上部署 Nginx 并优化以应对高流量网站教程
linux·运维·服务器·后端·nginx·ubuntu·性能优化
网硕互联的小客服3 小时前
如何排查香港服务器上的权限问题
linux·运维·服务器·网络·云计算
果汁分你一半l3 小时前
shell脚本的使用
linux·vim