Ubuntu 22.04执行sudo apt-get update时遇Release file not found错误求助
解决Ubuntu 22.04执行
apt update时的源错误 问题现象
执行sudo apt-get update时出现以下错误:
ICON_lab) randychen@randychen-Delta-15-A5EFK:~/projects$ sudo apt-get update Hit:1 http://us.archive.ubuntu.com/ubuntu jammy InRelease Get:2 http://us.archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB] Ign:3 http://packages.ros.org/ros/ubuntu jammy InRelease Err:4 http://packages.ros.org/ros/ubuntu jammy Release 404 Not Found [IP: 140.211.166.134 80] Get:5 http://us.archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB] Get:6 http://www.deb-multimedia.org jessie InRelease [15.4 kB] Hit:7 http://archive.ubuntu.com/ubuntu jammy InRelease Hit:8 http://security.ubuntu.com/ubuntu jammy-security InRelease Get:9 http://us.archive.ubuntu.com/ubuntu jammy-updates/main amd64 DEP-11 Metadata [95.1 kB] Get:10 http://us.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 DEP-11 Metadata [257 kB] Get:11 http://us.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 DEP-11 Metadata [940 B] Get:13 http://us.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 DEP-11 Metadata [11.4 kB] Ign:6 http://www.deb-multimedia.org jessie InRelease Hit:12 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease Reading package lists... Done E: The repository 'http://packages.ros.org/ros/ubuntu jammy Release' does not have 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://www.deb-multimedia.org jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5C808C2B65558117 E: Release file for http://www.deb-multimedia.org/dists/jessie/InRelease is expired (invalid since 388d 20h 52min 20s). Updates for this repository will not be applied. W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
错误分析与解决方案
1. ROS源404错误
ROS的ros/ubuntu仓库没有适配Ubuntu22.04(Jammy)的Release文件,因为ROS 1不支持该版本,ROS 2对应Jammy的源路径不同。
解决方法:
- 删除无效的ROS源配置:
sudo rm /etc/apt/sources.list.d/ros*.list - 如果需要安装ROS,针对Ubuntu22.04应安装ROS 2 Humble,添加对应源(可选操作):
sudo apt install curl gnupg lsb-release sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
2. deb-multimedia源过期+缺少密钥
你添加的是Debian Jessie版本的源,该版本早已停止维护,完全不兼容Ubuntu22.04。
解决方法:
- 删除该源配置:
sudo rm /etc/apt/sources.list.d/deb-multimedia*.list - 如需第三方多媒体源,建议替换为兼容Ubuntu22.04的官方或可信第三方源(非官方源存在安全风险,需自行确认)。
3. Slack源密钥存储在legacy位置
apt-key已被弃用,Slack的密钥存储在旧的trusted.gpg中,需要迁移到新的密钥存储目录。
解决方法:
- 导出Slack密钥并迁移到
/usr/share/keyrings:sudo apt-key export 4D08F937 | sudo gpg --dearmour -o /usr/share/keyrings/slack-keyring.gpg - 修改Slack源配置文件,更新密钥路径:
将原内容修改为指向新密钥文件的格式,最终内容应为:sudo nano /etc/apt/sources.list.d/slacktechnologies_slack.list
按deb [arch=amd64 signed-by=/usr/share/keyrings/slack-keyring.gpg] https://packagecloud.io/slacktechnologies/slack/debian jessie mainCtrl+O保存,Ctrl+X退出编辑器。
验证修复效果
执行以下命令确认问题已解决:
sudo apt-get update
内容的提问来源于stack exchange,提问作者Randy Chen
相关产品推荐
相关产品推荐

