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

更新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内容修改为空。

http://www.xdnf.cn/news/7879.html

相关文章:

  • 【css】 flex布局基本知识
  • Nginx 核心功能与 LNMP 环境搭建深度笔记
  • Android多线程下载文件拆解:原理、实现与优化
  • HarmonyOS 应用开发,如何引入 Golang 编译的第三方 SO 库
  • 第二章:Android常用UI控件
  • Nova Launcher:个性化安卓桌面,打造专属体验
  • 通过AIoTedge或ThingsKit物联网平台内置的Node-RED读取OPC-UA
  • 并发编程中的对象组合的哲学
  • Spring Boot接口通用返回值设计与实现最佳实践
  • 破解充电安全难题:智能终端的多重防护体系构建
  • java面试每日一背 day1
  • 分布式集群中的共识算法及其在时序数据库IoTDB中的应用
  • [250521] DBeaver 25.0.5 发布:SQL 编辑器、导航器全面升级,新增 Kingbase 支持!
  • AI 模型高效化:推理加速与训练优化的技术原理与理论解析
  • Java多线程随笔
  • 03-Web后端基础(Maven基础)
  • C#实现自己的MCP Client
  • CSS、SCSS 和 SASS 的语法差异
  • 将VMware上的虚拟机和当前电脑上的Wifi网卡处在同一个局域网下,实现同一个局域网下实现共享
  • 07SpringMVC底层形象解析
  • 2022年下半年信息系统项目管理师——综合知识真题及答案(5)
  • 使用Vite创建一个动态网页的前端项目
  • 1.0 Epson数据类型以及函数的传值与传址
  • 微信小程序中,解决lottie动画在真机不显示的问题
  • CSDN gitcode代码推送
  • 博主总结框架
  • RISC-V 开发板 MUSE Pi Pro CSI测试,一把点亮ov5647摄像头
  • R语言学习--Day05--绘图技巧
  • .NET外挂系列:5. harmony 中补丁参数的有趣玩法(下)
  • 野火鲁班猫(arrch64架构debian)从零实现用MobileFaceNet算法进行实时人脸识别(四)安装RKNN Toolkit Lite2