You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04安装Docker执行apt-get update报无Release文件404错误

Ubuntu 22.04安装Docker报源无Release文件错误

操作复现

在Ubuntu 22.04系统上安装Docker时,执行了以下命令:

$ sudo apt-get update
$ sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
$ sudo mkdir -p /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

执行sudo apt-get update时返回如下错误:

$ sudo apt-get update
Hit:1 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://id.archive.ubuntu.com/ubuntu jammy InRelease           
Hit:3 http://id.archive.ubuntu.com/ubuntu jammy-updates InRelease   
Hit:4 http://id.archive.ubuntu.com/ubuntu jammy-backports InRelease 
Ign:5 https://download.docker.com/linux/debian jammy InRelease
Get:6 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Err:7 https://download.docker.com/linux/debian jammy Release
  404  Not Found [IP: 108.138.141.89 443]
Reading package lists... Done                           
E: The repository 'https://download.docker.com/linux/debian 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.

经确认,Docker官方Ubuntu源的jammy版本路径下确实存在Release文件,当前系统信息如下:

.-/+oossssoo+/-.               tonysong@tonysong-desktop 
        `:+ssssssssssssssssss+:`           ------------------------- 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 22.04 LTS x86_64 
    .ossssssssssssssssssdMMMNysssso.       Kernel: 5.15.0-39-generic 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Uptime: 29 mins 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Packages: 1591 (dpkg), 11 (snap) 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Shell: bash 5.1.16 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Resolution: 2560x1440 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   DE: GNOME 42.1 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: Mutter 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM Theme: Adwaita 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Theme: Yaru-blue-dark [GTK2/3] 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Icons: Yaru-blue [GTK2/3] 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Terminal: gnome-terminal 
  +sssssssssdmydMMMMMMMMddddyssssssss+     CPU: AMD Ryzen 7 5700G with Radeon Graphics (16) @ 4.673GH 
   /ssssssssssshdmNNNNmyNMMMMhssssss/      GPU: AMD ATI 04:00.0 Cezanne 
    .ossssssssssssssssssdMMMNysssso.       Memory: 5179MiB / 31477MiB 
      -+sssssssssssssssssyyyssss+-
        `:+ssssssssssssssssss+:`                                   
            .-/+oossssoo+/-.                                       

错误原因

配置Docker软件源时误用了Debian系统的源地址:

  • 当前运行的是Ubuntu 22.04系统,但配置的源路径为https://download.docker.com/linux/debian
  • Debian的Docker源下不存在Ubuntu 22.04对应的jammy版本目录,因此请求时返回404,提示找不到Release文件

修复方法

  • 删除错误的源配置文件
sudo rm /etc/apt/sources.list.d/docker.list
  • 重新导入对应Ubuntu版本的Docker GPG公钥,写入正确的软件源配置
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • 重新执行源更新命令,报错即消失
sudo apt-get update

更新完成后即可正常执行Docker安装操作。


内容的提问来源于stack exchange,提问作者tonywei

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.29 14:09:28