apt-get update报错

root@2870e7cf8e74:/usr/tools# apt-get update
Ign:1 https://mirrors.aliyun.com/ubuntu trusty InRelease
Get:2 https://mirrors.aliyun.com/ubuntu trusty Release [58.5 kB]
Get:3 https://mirrors.aliyun.com/ubuntu trusty Release.gpg [933 B]
Ign:3 https://mirrors.aliyun.com/ubuntu trusty Release.gpg
Reading package lists... Done
W: GPG error: https://mirrors.aliyun.com/ubuntu trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'https://mirrors.aliyun.com/ubuntu trusty Release' 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.

解决办法:

将不可用的pubkey加到ubuntu服务器,从上面可以看到如下pubkey

NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32

使用以上pubkey拼接如下命令

 gpg --keyserver keyserver.ubuntu.com --recv 40976EAF437D05B5gpg --export --armor 40976EAF437D05B5 |  apt-key add -gpg --keyserver keyserver.ubuntu.com --recv 3B4FE6ACC0B21F32gpg --export --armor 3B4FE6ACC0B21F32 |  apt-key add -

我的环境因为是docker中的Python环境 ,默认用户是root,所以不用加sudo,如果非root用户可能会需要切换用户获取权限。则命令如下:

sudo gpg --keyserver keyserver.ubuntu.com --recv 40976EAF437D05B5
sudo gpg --export --armor 40976EAF437D05B5 | sudo apt-key add -
sudo gpg --keyserver keyserver.ubuntu.com --recv 3B4FE6ACC0B21F32
sudo gpg --export --armor 3B4FE6ACC0B21F32 | sudo apt-key add -

执行完以上命令后可以正常执行apt-update命令

root@2870e7cf8e74:/usr/tools# apt-get update
Ign:1 https://mirrors.aliyun.com/ubuntu trusty InRelease
Get:2 https://mirrors.aliyun.com/ubuntu trusty Release [58.5 kB]
Get:3 https://mirrors.aliyun.com/ubuntu trusty Release.gpg [933 B]
Get:4 https://mirrors.aliyun.com/ubuntu trusty/main amd64 Packages [1350 kB]
Get:5 https://mirrors.aliyun.com/ubuntu trusty/multiverse amd64 Packages [132 kB]
Get:6 https://mirrors.aliyun.com/ubuntu trusty/restricted amd64 Packages [13.0 kB]
Get:7 https://mirrors.aliyun.com/ubuntu trusty/universe amd64 Packages [5859 kB]
Fetched 7414 kB in 22s (343 kB/s)
Reading package lists... Done

apt-get update出现NO_PUBKEY问题解决相关推荐

  1. apt 的 update 和 upgrade 命令的区别是什么?

    如果想让你的 Ubuntu 或者 Debian 系统保持更新,要用 sudo apt update 和 sudo apt upgrade 命令组合. 一些以前的教程也会提到 sudo apt-get ...

  2. Ubuntu apt install / update错误前因后果: 连接失败 [IP: 91.189.91.* 80]

    同时更新Ubuntu系统和升级Python3.10时,期间命令删除"sudo apt remove Python3*"包,以为由此引发一系列问题,且最终的系统崩溃无法登陆.启动系统 ...

  3. Detailed errors from the package manager follow: apt transaction returned result exit-failed问题解决

    参考链接 问题描述: 当我在Ubuntu系统下安装搜狗输入法时,报获取软件源错误的信息. 解决方案: 更新软件源. 步骤如下: 1. 点击Software & Updates 2. 在Down ...

  4. Deepin15.7 Android8.1 编译 以及问题解决

    前几天装了deepin15.7美滋滋,然后开始折腾编译.LOS15.1(android8.1),在此记录遇到的问题 1.大天朝下载源码是个问题,换个hosts即可,这里我用的是 https://git ...

  5. Cubietruck开发板折腾009:升级apt后的故障解决

    前面我们遇到了Cubietruck开发板折腾008:apt-get update出现警告问题解决,我们通过apt-get install -f apt将apt进行了升级(之前百度了发现说apt与当前版 ...

  6. 鸟哥的Linux私房菜(服务器)- 簡易 APT/YUM 伺服器設定

    簡易 APT/YUM  伺服器設定 最近更新日期:2004/06/23 用不慣 Tarball 安裝套件卻又擔心 RPM 的屬性相依問題嗎?如果有一種套件管理工具可以克服 RPM 屬性相依的方法該有多 ...

  7. linux 设置更新源为cd,技术|如何修复 apt-get update 无法添加新的 CD-ROM 的错误

    这些天我正在体验Elementary OS Freya,在这期间,我遇到了一个非常常见的更新错误:Failed to fetch cdrom Please use apt-cdrom to make ...

  8. Ubuntu 22.04 LTS apt-get update 报 Key is stored in legacy trusted.gpg keyring 警告解决方案

    背景介绍 在 Ubuntu 22.04 LTS 下更新源 apt-get update 遇到了Key is stored in legacy trusted.gpg keyring (/etc/apt ...

  9. NVIDIA平台xavier upgrade update更新完后驱动丢失问题

    1. 背景 如果xavier平台修改了相应的底层驱动后: 如果联网升级软件[例: apt upgrade/update], 系统会重新升级系统,包括kernel 镜像.dtb等: 所以会导致之前加载的 ...

  10. failed to read artifact descriptor for *** 问题解决心得

    前提:更换maven版本,今天更换了maven的版本,从3.1.1更换为3.3.9,本来好好地项目更换完版本报了136个错,开头的几个错都是failed to read artifact descri ...

最新文章

  1. mac要装anaconda吗_Anaconda安装教程|Windows,Linux ,Mac OS
  2. find命令过滤 no such_运维老手常用的linux命令操作
  3. 让.NET程序会说话
  4. 为什么说人工智能是一个大谎言
  5. 求逆序对(信息学奥赛一本通-T1311)
  6. utf8转gb2312 c语言,UTF-8, Unicode, GB2312格式串转换之C语言版
  7. mac显示网速_Mac系统怎么查看测试网速
  8. python大写金额算法
  9. 福利!H3CNE认证网络工程师GB0-191 考试试题库超详细解析-02。持续更新~~
  10. How to Backdoor Federated Learning
  11. 201809-1 卖菜(100分)
  12. TCP的核心系列 — SACK和DSACK的实现(六)
  13. 如何完全清除linux内核,清除旧的Linux内核
  14. input框动态模糊查询,能输入,能选择
  15. 环境变量之java环境变量
  16. uni-app中,文字超出隐藏并显示省略号(实现展开、收起全文)
  17. 浏览器Goole Chrome调试工具
  18. 微信公众号支付详细步骤(整理)
  19. operator*() 和 operator-()
  20. linux 编译QT atom,QT5 编译使用TagLib

热门文章

  1. Android的Wifi系统框架分析第一篇
  2. 单机实验mysql的主从备份(master slaver)
  3. better-scroll在vue中的使用
  4. 神经网络-GoogleNet的发展,介绍,贡献
  5. Django model 反向引用中的related_name
  6. 【HTTP请求】、详解
  7. 涨姿势系列之——内核环境下花式获得CSRSS进程id
  8. Oracle数据泵的使用
  9. 手机背景图片在安卓手机上不显示
  10. 是时候了,我们需要前端架构师