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

Pop!_OS 22.04安装Docker时出现apt源404错误求助

问题描述

我的系统信息(lsb_release -a输出):

Distributor ID: Pop
Description:    Pop!_OS 22.04 LTS
Release:    22.04
Codename:   jammy

我误按照Debian的Docker安装教程操作,执行sudo apt-get update时出现以下错误:

>sudo apt-get update
Ign:1 https://download.docker.com/linux/debian jammy InRelease
Hit:2 http://apt.pop-os.org/proprietary jammy InRelease
Hit:3 http://apt.pop-os.org/release jammy InRelease
Err:4 https://download.docker.com/linux/debian jammy Release
  404  Not Found [IP: 18.67.240.19 443]
Hit:5 http://apt.pop-os.org/ubuntu jammy InRelease
Hit:6 http://apt.pop-os.org/ubuntu jammy-security InRelease
Hit:7 http://apt.pop-os.org/ubuntu jammy-updates InRelease
Hit:8 http://apt.pop-os.org/ubuntu jammy-backports InRelease
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.

我的/etc/apt/sources.list文件内容如下(仅注释,无有效源):

## See sources.list(5) for more information, especialy
# Remember that you can only use http, ftp or file URIs
# CDROMs are managed through the apt-cdrom tool.
# deb cdrom:[Pop_OS 22.04 _Jammy Jellyfish_ - Release amd64 (20221026)]/ jammy main restricted
# deb cdrom:[Pop_OS 22.04 _Jammy Jellyfish_ - Release amd64 (20221026)]/ stable main restricted
# deb cdrom:[Pop_OS 22.04 _Jammy Jellyfish_ - Release amd64 (20221026)]/ unstable main restricted

我曾尝试添加[trusted=yes] https://download.docker.com/linux/debian,但问题依旧。

解决方案

核心问题

你用了Debian的Docker源,但Pop!_OS 22.04基于Ubuntu Jammy,Debian源里没有jammy版本的Release文件,所以报404错误。

修复步骤

  1. 删除错误的Debian Docker源
    先找到添加的错误源文件,通常存放在/etc/apt/sources.list.d/目录下,文件名类似docker.list:

    sudo rm /etc/apt/sources.list.d/docker.list
    

    不确定文件名的话,可先列出目录内容确认:

    ls /etc/apt/sources.list.d/
    
  2. 添加正确的Ubuntu Docker源
    执行以下命令添加适配Ubuntu Jammy的Docker官方源:

    # 导入Docker官方GPG密钥
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg
    # 添加适配jammy的源
    echo "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    
  3. 更新软件包列表并安装Docker

    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    
  4. 验证安装结果
    运行hello-world容器测试Docker是否正常工作:

    sudo docker run hello-world
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.16 20:13:27