Docker存储库在Ubuntu上运行apt-get update时没有发布文件

Dan*_*gle 68 ubuntu apt-get docker

我正在使用Ubuntu 16.10并且最近使用Xenial版本安装了Docker(v1.12.4),遵循此处的说明.我没有遇到任何创建容器的问题,确保它们自动重启等.

但是,现在每次运行apt-get update时,都会收到以下错误消息:

W: The repository 'https://apt.dockerproject.org/repo ubuntu-xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://apt.dockerproject.org/repo/dists/ubuntu-xenial/main/binary-amd64/Packages
E: Some index files failed to download. They have been ignored, or old ones used instead.
Run Code Online (Sandbox Code Playgroud)

我试图通过遵循此处发现的建议来解决问题,但似乎无法解决此问题.

有没有人遇到这个并修复过它?如果是这样,需要解决这个问题?

Sal*_*ami 66

在linux mint上,官方说明对我不起作用.我不得不进入/etc/apt/sources.list.d/additional-repositories.list并改变serenaxenial.

  • 感谢目录sources.list.d 参考。使用 "sudo rm /etc/apt/sources.list.d/docker*" 修复了 Ubuntu xenial 问题。现在 apt-get update 终于可以工作了。 (4认同)
  • 请注意,出于某种原因,在我的文件中有一个带有`trusty`的码头工人线,另一个带有`serena`的码头工人线。也许我曾经尝试过同样的过程,却忘记了。无论如何,我必须删除“ trusty”行,否则它将抱怨无法解决的依赖关系。 (2认同)
  • 对于 Debian 来说也是如此:将文件“/etc/apt/sources.list.d/docker.list”中的“debian 10 stable”替换为“debianstretch stable”,它应该可以工作。 (2认同)
  • 我不得不将我的改为“仿生” (2认同)

War*_*zee 55

对于Linux Mint,Docker网站实际上引用了这个问题:

注意:下面的lsb_release -cs子命令返回Ubuntu发行版的名称,例如xenial.有时,在像Linux Mint这样的发行版中,您可能需要将$(lsb_release -cs)更改为您的父Ubuntu发行版.例如,如果您使用的是Linux Mint Rafaela,则可以使用trusty.AMD64:

$ sudo add-apt-repository \"deb [arch = amd64] https://download.docker.com/linux/ubuntu\$(lsb_release -cs)\
stable"

lsb_release -cs命令提供了一个Docker没有准备好包的存储库 - 您必须将其更改为xenial.

Linux Mint 18的正确命令是基于Ubuntu 16.04 Xenial

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   xenial \
   stable"
Run Code Online (Sandbox Code Playgroud)


小智 15

艾略特海滩是对的.谢谢Elliot.

这是我的要点的代码.

sudo apt-get remove docker docker-engine docker.io

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo apt-key fingerprint 0EBFCD88

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
xenial \
stable"

sudo apt-get update

sudo apt-get install docker-ce

sudo docker run hello-world
Run Code Online (Sandbox Code Playgroud)

  • 如果不运行xenial,请仔细运行这些命令。此命令将是更安全的`add-apt-repository“ deb [arch = amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs)稳定” (2认同)

小智 11

虽然这是一篇较旧的帖子,但我昨天遇到了类似的问题。Docker 自己网站上的说明不适合我,并且我收到了许多安装错误:(在终端输出的一些有问题的行下方):

Get:6 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Err:7 https://download.docker.com/linux/debian focal Release
  404  Not Found [IP: 13.227.219.37 443]
Reading package lists... Done                            
E: The repository 'https://download.docker.com/linux/debian focal 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.
root@<my-server-name>:~# sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'docker-ce' has no installation candidate
E: Unable to locate package docker-ce-cli
E: Unable to locate package containerd.io
E: Couldn't find any package by glob 'containerd.io'
E: Couldn't find any package by regex 'containerd.io'
E: Unable to locate package docker-compose-plugin
root@<my-server-name>:~# sudo apt-get upgrade
Run Code Online (Sandbox Code Playgroud)

经过搜索并尝试多个修复后,我发现 #Prashant Abdare 提供的响应是最有用的。运行以下命令后:

$ cat /etc/debian_version
Run Code Online (Sandbox Code Playgroud)

我得到以下输出:

靶心/锡德

由于我没有安装 xed 编辑器,因此我只是在服务器根目录下将 #Prashant Abdare 的命令替换为 sudo nano:

$ sudo nano /etc/apt/sources.list.d/docker.list
Run Code Online (Sandbox Code Playgroud)

接下来,我简单地编辑了该条目(正如他所指出的),将其中的 Debian 版本从 fom 更改为 Namely,从(不正确):

deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian   focal stable
Run Code Online (Sandbox Code Playgroud)

至(正确,对于我的系统):

deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian   bullseye stable
Run Code Online (Sandbox Code Playgroud)

之后,我只需运行以下命令(来自 Docker 的原始指令):

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Run Code Online (Sandbox Code Playgroud)

这次,安装工作非常顺利,之前的问题(来自上面粘贴的终端输出行)得到了修复,从而更新到版本 20.10.17:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bridge-utils dns-root-data dnsmasq-base libidn11 ubuntu-fan
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  docker-ce-rootless-extras docker-scan-plugin slirp4netns
Suggested packages:
  aufs-tools cgroupfs-mount | cgroup-lite
The following packages will be REMOVED:
  containerd docker.io runc
The following NEW packages will be installed:
  containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin docker-scan-plugin slirp4netns
0 upgraded, 7 newly installed, 3 to remove and 0 not upgraded.
Need to get 108 MB of archives.
After this operation, 115 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.digitalocean.com/ubuntu focal/universe amd64 slirp4netns amd64 0.4.3-1 [74.3 kB]
Get:2 https://download.docker.com/linux/debian bullseye/stable amd64 containerd.io amd64 1.6.7-1 [28.1 MB]
Get:3 https://download.docker.com/linux/debian bullseye/stable amd64 docker-ce-cli amd64 5:20.10.17~3-0~debian-bullseye [40.6 MB]
Get:4 https://download.docker.com/linux/debian bullseye/stable amd64 docker-ce amd64 5:20.10.17~3-0~debian-bullseye [21.0 MB]
Get:5 https://download.docker.com/linux/debian bullseye/stable amd64 docker-ce-rootless-extras amd64 5:20.10.17~3-0~debian-bullseye[8159 kB]
Get:6 https://download.docker.com/linux/debian bullseye/stable amd64 docker-compose-plugin amd64 2.6.0~debian-bullseye [6562 kB]
Get:7 https://download.docker.com/linux/debian bullseye/stable amd64 docker-scan-plugin amd64 0.17.0~debian-bullseye [3520 kB]
Fetched 108 MB in 2s (44.9 MB/s)         
(Reading database ... 95602 files and directories currently installed.)
Removing docker.io (20.10.12-0ubuntu2~20.04.1) ...
'/usr/share/docker.io/contrib/nuke-graph-directory.sh' -> '/var/lib/docker/nuke-graph-directory.sh'
Removing containerd (1.5.9-0ubuntu1~20.04.4) ...
Removing runc (1.1.0-0ubuntu1~20.04.1) ...
Selecting previously unselected package containerd.io.
(Reading database ... 95340 files and directories currently installed.)
Preparing to unpack .../0-containerd.io_1.6.7-1_amd64.deb ...
Unpacking containerd.io (1.6.7-1) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../1-docker-ce-cli_5%3a20.10.17~3-0~debian-bullseye_amd64.deb ...
Unpacking docker-ce-cli (5:20.10.17~3-0~debian-bullseye) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../2-docker-ce_5%3a20.10.17~3-0~debian-bullseye_amd64.deb ...
Unpacking docker-ce (5:20.10.17~3-0~debian-bullseye) ...
Selecting previously unselected package docker-ce-rootless-extras.
Preparing to unpack .../3-docker-ce-rootless-extras_5%3a20.10.17~3-0~debian-bullseye_amd64.deb...
Unpacking docker-ce-rootless-extras (5:20.10.17~3-0~debian-bullseye) ...
Selecting previously unselected package docker-compose-plugin.
Preparing to unpack .../4-docker-compose-plugin_2.6.0~debian-bullseye_amd64.deb ...
Unpacking docker-compose-plugin (2.6.0~debian-bullseye) ...
Selecting previously unselected package docker-scan-plugin.
Preparing to unpack .../5-docker-scan-plugin_0.17.0~debian-bullseye_amd64.deb ...
Unpacking docker-scan-plugin (0.17.0~debian-bullseye) ...
Selecting previously unselected package slirp4netns.
Preparing to unpack .../6-slirp4netns_0.4.3-1_amd64.deb ...
Unpacking slirp4netns (0.4.3-1) ...
Setting up slirp4netns (0.4.3-1) ...
Setting up docker-scan-plugin (0.17.0~debian-bullseye) ...
Setting up containerd.io (1.6.7-1) ...
Setting up docker-compose-plugin (2.6.0~debian-bullseye) ...
Setting up docker-ce-cli (5:20.10.17~3-0~debian-bullseye) ...
Setting up docker-ce-rootless-extras (5:20.10.17~3-0~debian-bullseye) ...
Setting up docker-ce (5:20.10.17~3-0~debian-bullseye) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.17) ...
root@<my-server-name>:~# sudo nano /etc/apt/sources.list.d/docker.list
root@<my-server-name>:~# docker --version
Docker version 20.10.17, build 100c701
root@<my-server-name>:~# hostnamectl
Run Code Online (Sandbox Code Playgroud)

再次感谢@Prashant Abdare 分享这个解决方案,并感谢@Deep Kakkar 最近的编辑。


Ale*_*nov 10

Linux Mint的20 Ulyana用户需要改变“ulyana”“仿生”

/etc/apt/sources.list.d/additional-repositories.list

像这样:

deb [arch=amd64] https://download.docker.com/linux/ubuntu    bionic    stable
Run Code Online (Sandbox Code Playgroud)


小智 10

我使用的是 Kubuntu 20.04。如果我cat /etc/os-release,我看到:

VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
Run Code Online (Sandbox Code Playgroud)

但是,在我的文件中/etc/apt/sources.list.d/docker.list我有这一行:

deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian jammy stable
Run Code Online (Sandbox Code Playgroud)

解决办法是改成debianubuntu然后就成功了。


Nic*_*s D 9

我在这里看到Ikraider的一篇有趣帖子解决了我的问题:https: //github.com/docker/docker/issues/22599

网站说明有误,这是16.04的作用:

curl -s https://yum.dockerproject.org/gpg | sudo apt-key add
apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
sudo add-apt-repository "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main"
sudo apt-get update
sudo apt-get install docker-engine=1.13.0-0~ubuntu-xenial
Run Code Online (Sandbox Code Playgroud)


小智 9

正如官方docker文档中所建议的那样。尝试运行此:

  • sudo vi /etc/apt/sources.list

然后删除/注释文件末行中的任何(deb [arch=amd64] https://download.docker.com/linux/ubuntu/ xenial stable)这样的条目。

然后在终端中运行以下命令:

  • sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu/ bionic stable"

  • sudo apt-get update

就我而言,它奏效了。


Dan*_*gle 7

以下是用于解决问题的步骤列表:

  1. 删除Docker(这不会删除图像,容器,卷或自定义配置文件):

    sudo apt-get purge docker-engine

  2. 删除Docker apt键:

    sudo apt-key del 58118E89F3A912897C070ADBF76221572C52609D

  3. 删除docker.list文件:

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

  4. 手动删除apt缓存文件:

    sudo rm /var/lib/apt/lists/apt.dockerproject.org_repo_dists_ubuntu-xenial_*

  5. 删除apt-transport-httpsca-certificates:

    sudo apt-get purge apt-transport-https ca-certificates

  6. 清洁apt并执行autoremove:

    sudo apt-get clean && sudo apt-get autoremove

  7. 重启Ubuntu:

    sudo重启

  8. 运行apt-get update:

    sudo apt-get update

  9. 再次安装apt-transport-https和ca-certificates:

    sudo apt-get install apt-transport-https ca-certificates

  10. 添加apt键:

    sudo apt-key adv\--keyserver hkp://ha.pool.sks-keyservers.net:80\--recv-keys 58118E89F3A912897C070ADBF76221572C52609D

  11. 再次添加docker.list文件:

    echo"deb https://apt.dockerproject.org/repo ubuntu-xenial main"| sudo tee /etc/apt/sources.list.d/docker.list

  12. 运行apt-get update:

    sudo apt-get update

  13. 安装Docker:

    sudo apt-get install docker-engine

当然,有很多变量,你的结果可能会有所不同.但是,这些步骤涵盖尽可能多的区域,以确保清洗潜在的问题点,从而使成功的可能性更高.

更新7/6/2017

似乎较新版本的Docker正在使用不同的安装过程,这应该消除许多这些问题.请务必查看https://docs.docker.com/engine/installation/linux/ubuntu/.


小智 6

我在 Linux mint 上遇到了类似的问题,我发现 Debian 版本使用的是,

$ cat /etc/debian_version buster/sid

然后替换 Debian 版本

$ sudo vi /etc/apt/sources.list.d/additional-repositories.list
deb [arch=amd64] https://download.docker.com/linux/debian    buster    stable
Run Code Online (Sandbox Code Playgroud)


归档时间:

查看次数:

62027 次

最近记录:

5 年,11 月 前