Ubuntu 22.04 jammy 的镜像使用apt update失败

这篇具有很好参考价值的文章主要介绍了Ubuntu 22.04 jammy 的镜像使用apt update失败。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Ubuntu 22.04 jammy 的镜像使用apt update失败

1. 问题现象

# 下载镜像
~]# docker pull ubuntu:22.04
22.04: Pulling from library/ubuntu
79d0ea7dc1a8: Pull complete 
Digest: sha256:dfd64a3b4296d8c9b62aa3309984f8620b98d87e47492599ee20739e8eb54fbf
Status: Downloaded newer image for ubuntu:22.04
docker.io/library/ubuntu:22.04

# 进入容器
docker run -it ubuntu:22.04 bash

# 更新包
root@e0ab4ec26d51:/# apt update
Get:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease [270 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease [119 kB]
Err:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease [108 kB]
Err:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease [110 kB]
Err:3 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:4 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Reading package lists... Done
W: http://ports.ubuntu.com/ubuntu-ports/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://ports.ubuntu.com/ubuntu-ports/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://ports.ubuntu.com/ubuntu-ports jammy 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.
W: http://ports.ubuntu.com/ubuntu-ports/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://ports.ubuntu.com/ubuntu-ports/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://ports.ubuntu.com/ubuntu-ports jammy-updates 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.
W: http://ports.ubuntu.com/ubuntu-ports/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://ports.ubuntu.com/ubuntu-ports/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://ports.ubuntu.com/ubuntu-ports jammy-backports 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.
W: http://ports.ubuntu.com/ubuntu-ports/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://ports.ubuntu.com/ubuntu-ports/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://ports.ubuntu.com/ubuntu-ports jammy-security 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.

2. 尝试方法

# 1.添加key文件
root@e0ab4ec26d51:/# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation
# 失败,缺少命令

# 2.尝试使用gpg添加key文件
# gpg --keyserver keyserver.ubuntu.com --recv 3B4FE6ACC0B21F32
# gpg --export --armor 3B4FE6ACC0B21F32 |apt-key add -
root@e0ab4ec26d51:/# gpg --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
bash: gpg: command not found
root@e0ab4ec26d51:/# gpg --keyserver keyserver.ubuntu.com --recv 467B942D3A79BD29^C
root@e0ab4ec26d51:/# apt install gpg
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package gpg
# 失败,缺少命令

# 尝试更换apt镜像源
root@e0ab4ec26d51:/# echo "deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
" > /etc/apt/sources.list
root@e0ab4ec26d51:/# apt update
Get:1 http://mirrors.aliyun.com/ubuntu jammy InRelease [270 kB]
Get:2 http://mirrors.aliyun.com/ubuntu jammy-security InRelease [110 kB]
Get:3 http://mirrors.aliyun.com/ubuntu jammy-updates InRelease [119 kB]
Err:1 http://mirrors.aliyun.com/ubuntu jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:4 http://mirrors.aliyun.com/ubuntu jammy-backports InRelease [108 kB]
Err:2 http://mirrors.aliyun.com/ubuntu jammy-security InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:3 http://mirrors.aliyun.com/ubuntu jammy-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:4 http://mirrors.aliyun.com/ubuntu jammy-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Reading package lists... Done
W: http://mirrors.aliyun.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://mirrors.aliyun.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://mirrors.aliyun.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://mirrors.aliyun.com/ubuntu jammy 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.
W: http://mirrors.aliyun.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://mirrors.aliyun.com/ubuntu/dists/jammy-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://mirrors.aliyun.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://mirrors.aliyun.com/ubuntu jammy-security 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.
W: http://mirrors.aliyun.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://mirrors.aliyun.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://mirrors.aliyun.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://mirrors.aliyun.com/ubuntu jammy-updates 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.
W: http://mirrors.aliyun.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://mirrors.aliyun.com/ubuntu/dists/jammy-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://mirrors.aliyun.com/ubuntu jammy-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://mirrors.aliyun.com/ubuntu jammy-backports 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.
# 失败,还是不行

3. 解决办法

# 解决方法:
# 从报错来看是镜像仓库没有认证,不是安全的,可以通过 --allow-insecure-repositories 参数解决

# 以下为一般镜像仓库出问题的解决办法
1. 检查源是否正确,检查源的地址是否正确,检查源的类型是否正确;

2. 尝试更换源,更换源的方法可以参考Ubuntu官方文档;

3. 尝试更换源的类型,比如从http更换为https;

4. 尝试更换源的地址,比如从国内源更换为国外源;

5. 尝试更换源的更新方式,比如从apt-get更换为aptitude;

6. 尝试更换源的更新模式,比如从自动更新模式更换为手动更新模式;

7. 尝试更换源的更新模式,比如从自动更新模式更换为手动更新模式;

8. 尝试更换源的更新模式,比如从自动更新模式更换为手动更新模式;

9. 尝试更换源的更新模式,比如从自动更新模式更换为手动更新模式;

10. 尝试更换源的更新模式,比如从自动更新模式更换为手动更新模式;

11. 尝试更换源的更新模式,比如从自动更新模式更换为手动更新模式;

12. 尝试更换源的更新模式,比如从自动更新模式更换为手动更新模式;

13. 尝试更换源的更新模式,比如从自动更新模式更换为手动更新模式;

14. 尝试使用apt-get clean命令清理缓存;

15. 尝试使用apt-get update --allow-insecure-repositories命令允许更新不安全的源;

16. 尝试使用apt-get update --allow-unauthenticated命令允许更新不受信任的源;

17. 尝试使用apt-get update --allow-unauthenticated --allow-insecure-repositories命令允许更新不受信任和不安全的源;

18. 尝试使用apt-get update --allow-unauthenticated --allow-insecure-repositories --allow-releaseinfo-change命令允许更新不受信任、不安全和发行信息变更的源;

19. 尝试使用apt-get update --allow-unauthenticated --allow-insecure-repositories --allow-releaseinfo-change --allow-downgrades命令允许更新不受信任、不安全、发行信息变更和降级的源;

20. 尝试使用apt-get update --allow-unauthenticated --allow-insecure-repositories --allow-releaseinfo-change --allow-downgrades --allow-change-held-packages命令允许更新不受信任、不安全、发行信息变更、降级和更改已安装软件包的源。

文章来源地址https://www.toymoban.com/news/detail-776180.html

到了这里,关于Ubuntu 22.04 jammy 的镜像使用apt update失败的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • ubuntu 22.04 设置 apt 代理 配置 清华源 add-apt-repository 代理

    curl 设置 代理 sudo curl -x “http://192.168.1.2:3128” 需要验证的代理 sudo curl -x “http://username:password@192.168.1.2:3128” 另一种临时代理 https://askubuntu.com/questions/53146/how-do-i-get-add-apt-repository-to-work-through-a-proxy 如果没有代理配置文件就创建一个 sudo touch /etc/apt/apt.conf.d/proxy.conf 编辑配置

    2024年02月05日
    浏览(41)
  • Ubuntu22.04 apt 安装 ROS1 ROS Noetic Ninjemys

    众所周知ROS2还有很多功能没有移植,而ROS1官方不再支持 Ubuntu20.04 之后的版本。另一方面Ubuntu22.04 更新了很多对新硬件的驱动,有更好的兼容性和体验,这就变的很纠结。 如果想在 22.04 使用最新版本的 ROS Noetic 只有自己编译一个办法。编译整套ROS。 对于初学者来说是个不小

    2024年04月11日
    浏览(82)
  • Ubuntu22.04更换阿里镜像源

    由于Ubuntu默认源的服务器在国外,会导致下载软件非常缓慢,甚至无法访问,因此安装ubuntu后建议进行换源操作。换源步骤如下: 1.备份源文件 通过以下命令对官方源的配置文件进行备份 2.修改源 如果没有默认安装vim,则可以将上述命令中vim替换为vi 3.修改源配置文件内容

    2024年04月08日
    浏览(89)
  • Ubuntu22.04更换国内镜像源(阿里云)

    Ubuntu采用apt作为软件安装工具,其镜像源列表记录在/etc/apt/source.list文件中。 首先将source.list复制为source.list.bak备份。 修改完成后保存source.list文件,需要执行命令后才能生效: 本文为 Ubuntu 22.04 的阿里云镜像源列表。若为其他版本,将所有jammy更改为其他版本代号即可。 常

    2024年02月12日
    浏览(42)
  • 系统篇:ubuntu 22.04 iptables 运行失败解决方法

    一、现象 可能出现如下类似错误 二、原因 ubuntu 22.04默认使用nftables作为防火墙,而非iptables。 三、解决方法

    2024年02月16日
    浏览(43)
  • ubuntu22.04 服务器 SSH 密钥登录失败

    SSH密钥登录,是将SSH公钥写入服务端的 ~/.ssh/authorized_keys 文件中。 今天装了ubuntu22.04的系统,按照以往操作,在服务端配置了SSH公钥之后,发现竟然无法登录。 首先查看OpenSSH版本: 查看 /var/log/auth.log 文件,发现有如下错误信息: 通过错误信息来看,填入 authorized_keys 文件的

    2024年01月18日
    浏览(86)
  • ubuntu 22.04 apt-get 安装软件报错:Temporary failure resolving ‘cn.archive.ubuntu.com‘

    Err:1 http://cn.archive.ubuntu.com/ubuntu jammy/main amd64 libtcl8.6 amd64 8.6.12+dfsg-1build1 Temporary failure resolving ‘cn.archive.ubuntu.com’ Err:2 http://cn.archive.ubuntu.com/ubuntu jammy/main amd64 tcl8.6 amd64 8.6.12+dfsg-1build1 Temporary failure resolving ‘cn.archive.ubuntu.com’ Err:3 http://cn.archive.ubuntu.com/ubuntu jammy/universe amd6

    2024年04月10日
    浏览(65)
  • Ubuntu修改源镜像方法(22.04也能用)附带常用源镜像地址

    Ubuntu系统下载 | Ubuntu Ubuntu 22.04下载, Ubuntu 21.10下载, Ubuntu 服务器下载, Ubuntu系统下载, Ubuntu官网系统下载, Ubuntu OpenStack https://cn.ubuntu.com/download 将sources.list备份保存为sources.backup.list,以防止有需要的时候更换回来。 清华镜像源 清华源镜像地址 ubuntu | 镜像站使用帮助 | 清华

    2024年02月05日
    浏览(45)
  • ubuntu 22.04配置国内镜像源: 阿里云/清华大学/中科大

    Ubuntu 22.04 LTS这是一个长期支持版本,它将被支持五年,直到2027年4月。已发布的LTS版本带来了一些新的功能 国内有很多Ubuntu 22.04的镜像源,包括阿里、网易,还有很多教育网的镜像源,比如清华源、中科大源。 在教程中我们将介绍如何更改镜像在ubuntu 22.04。国内的包括有镜

    2024年02月09日
    浏览(60)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包