当前位置: 首页 > news >正文

更新ubuntu软件源遇到GPG error

BUG背景

执行sudo apt update后遇到类似下列报错:

E: The repository 'https://download.docker.com/linux/ubuntu bionic Release' no longer has a Release file.
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: GPG error: http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease: Unknown error executing apt-key
E: The repository 'http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic 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: GPG error: http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease: Unknown error executing apt-key
E: The repository 'http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-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: GPG error: http://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease: Unknown error executing apt-key

原因

一般来说,ubuntu22.04软件源读取/etc/apt/sources.list中的地址。但这个bug的原因是:使用的是/etc/apt/sources.list.d目录下的源地址,正常22.04不应该,24.04优先级才调整到这个目录下。

解决方案

在/etc/apt/sources.list.d下新建ubuntu.list,内容:

# 针对ubuntu22.04版本的,其他版本需要修改
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg]  http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse 
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg]  http://archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse 
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg]  http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse 
deb [signed-by=/usr/share/keyrings/ubuntu-archive-keyring.gpg]  http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse

将/etc/apt/sources.list内容修改为空。

相关文章:

  • MySQL中的重要常见知识点(入门到入土!)
  • Python高效网络爬虫开发指南
  • 日语学习-日语知识点小记-构建基础-JLPT-N4阶段(26):のは ・ のが ・ のを
  • 东莞一锂离子电池公司IPO终止,客户与供应商重叠,社保缴纳情况引疑
  • 力扣周赛置换环的应用,最少交换次数
  • Python爬虫实战:获取小说网最新风云榜数据并分析,为创作者提供参考素材
  • python-leetcode 71.每日温度
  • 【技术揭秘】Profinet转RS485如何优化冲剪机的实时通信性能?​​
  • App 出海:全渠道营销如何通过性能监控与精准归因实现增长
  • 【C++ Primer 学习札记】函数传参问题
  • Xilinx XCAU10P-2FFVB676I 赛灵思 Artix UltraScale+ FPGA
  • Xilinx 7Series\UltraScale FPGA MultiBoot Fallback
  • 力扣-三数之和
  • 浙大团队研发Earth Explorer系统,探索深时演化/地学剖面/科研场景,赋能深时地球科学研究
  • 可理解性输入:逛超市
  • 教师角色的转变:从知识传授者到学习引导者
  • LeetCode 1004. 最大连续1的个数 III
  • 友达15.6寸G156HAN02.3工业显示模组
  • Redis String 设计思想深度解析
  • Datacom-hcia~Datacom-hcie学习笔记索引
  • 舟山网站制作/推广普通话手抄报简单