apt 更新 docker.com Release 404 未找到

sol*_*ier 5 upgrade updates apt 18.04

我最近尝试使用这种方法安装 docker

curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
Run Code Online (Sandbox Code Playgroud)

但它对我不起作用,可能是损坏的软件包或其他东西,之后我使用 apt 方法安装了 docker && docker compose 并且效果很好但是当我尝试更新或升级我的系统时,我可以看到以下消息我实际上不知道是什么是问题请给我一个解决方案谢谢。

$ sudo apt-get update

Hit:1 http://ppa.launchpad.net/daniruiz/flat-remix/ubuntu bionic InRelease
Hit:2 https://dl.winehq.org/wine-builds/ubuntu bionic InRelease                                    
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease                                  
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease                                       
Hit:5 http://dl.google.com/linux/chrome/deb stable Release                                         
Hit:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease                                  
Hit:7 http://lk.archive.ubuntu.com/ubuntu bionic InRelease                                         
Ign:9 https://download.docker.com/linux/debian bionic InRelease                                    
Hit:10 http://lk.archive.ubuntu.com/ubuntu bionic-updates InRelease                                
Err:11 https://download.docker.com/linux/debian bionic Release                                     
  404  Not Found [IP: 13.35.8.98 443]
Hit:13 http://lk.archive.ubuntu.com/ubuntu bionic-backports InRelease                              
Hit:12 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease
Reading package lists... Done                                
E: The repository 'https://download.docker.com/linux/debian bionic 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.


$ sudo apt-get upgrade

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libxml2 libxml2:i386
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Run Code Online (Sandbox Code Playgroud)

如何从我的源列表中删除,因为我不再需要它

mch*_*hid 15

根据Ubuntu 的 docker 页面,问题是它应该是https://download.docker.com/linux/ubuntu而不是https://download.docker.com/linux/debian.

运行以下命令来解决这个问题:

sudo sed -i 's/debian/ubuntu/g' /etc/apt/sources.list.d/docker.list
sudo apt update
Run Code Online (Sandbox Code Playgroud)

但是,如果这不能解决问题,请运行以下命令:

sudo sed -i 's|docker.com/linux/debian|docker.com/linux/ubuntu|g' /etc/apt/sources.list
sudo apt update
Run Code Online (Sandbox Code Playgroud)


小智 9

我在 Linux Mint 中使用了以下内容:

  1. 使用以下命令确定 Ubuntu 代号(而不是版本代号):

    $ cat /etc/os-release | grep -i codename
    VERSION_CODENAME=una
    UBUNTU_CODENAME=focal
    
    Run Code Online (Sandbox Code Playgroud)
  2. 将 Ubuntu 代号替换为/etc/apt/sources.list.d/docker.list

    https://download.docker.com/linux/ubuntu <CODENAME> stable
    
    Run Code Online (Sandbox Code Playgroud)

    就我而言,docker 网站上的命令已将代号设置为una(docker 使用 确定它lsb_release -cs),但我必须将其更改为focus