记一次Ubuntu19无法安装docker源

按照各大网站以及个人习惯我会使用下面这种方法添加Docker源:

[email protected]:~# sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu  $(lsb_release -cs) stable"

然而使用上面这条命令给我带来了无尽的烦恼,甚至我都怀疑我是不是一个合格的linux工程师了,使用了这条命令提示以下错误:

Ign:1 https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan InRelease

Err:2 https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan Release
404 Not Found [IP: 218.104.71.170 443]
Hit:3 http://cn.archive.ubuntu.com/ubuntu eoan InRelease
Hit:4 http://cn.archive.ubuntu.com/ubuntu eoan-updates InRelease
Hit:5 http://cn.archive.ubuntu.com/ubuntu eoan-backports InRelease
Hit:6 http://cn.archive.ubuntu.com/ubuntu eoan-security InRelease
Reading package lists... Done
E: The repository ‘https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan 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.

下面是apt源文件中的内容:

deb [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

发现是没有任何错误的,但是你会发现在使用apt更新时会出现各种各样报错,最终还是没有你想要的docker-ce安装包,还是无法安装:

[email protected]:~# apt-get update
Get:1 http://cn.archive.ubuntu.com/ubuntu eoan InRelease [255 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu eoan-updates InRelease [88.4 kB]
Hit:3 http://cn.archive.ubuntu.com/ubuntu eoan-backports InRelease
Get:4 http://cn.archive.ubuntu.com/ubuntu eoan-security InRelease [92.9 kB]
Ign:5 https://download.docker.com/linux/ubuntu eoan InRelease
Err:6 https://download.docker.com/linux/ubuntu eoan Release
  404  Not Found [IP: 13.225.103.32 443]
Reading package lists... Done
E: The repository ‘https://download.docker.com/linux/ubuntu eoan 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.
[email protected]:~# apt search docker-ce[email protected]:~#

遇到这种问题我也觉得很头疼,在网上找了很多解决方法都是不行,有人都说是网络问题无法使用外网的源码库,我看到这个文章我都懵了,我还试过安装网易、阿里以及科大的源都不能更好的解决问题,其实这个很简单看一下阿里、科大和网易的他们的源码库是怎么往配置文件里面写的,然后比葫芦画瓢画一个不就完了

解决方法:

在sources.list添加下面这一条就可以:

deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

更新apt源:

[email protected]:~# apt-get  updateGet:1 http://cn.archive.ubuntu.com/ubuntu eoan InRelease [255 kB]Get:2 http://cn.archive.ubuntu.com/ubuntu eoan-updates InRelease [88.4 kB]Hit:3 http://cn.archive.ubuntu.com/ubuntu eoan-backports InReleaseGet:4 http://cn.archive.ubuntu.com/ubuntu eoan-security InRelease [92.9 kB]Get:5 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB] Get:6 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [9,594 B] Fetched 511 kB in 11s (48.3 kB/s) Reading package lists... Done[email protected]:~#

这样就好了,不报错了,再看看docker-ce这个安装包有没有:

[email protected]:~# apt search docker-ce
Sorting... Done
Full Text Search... Done
docker-ce/bionic,now 5:19.03.4~3-0~ubuntu-bionic amd64 [installed]
  Docker: the open-source application container engine

docker-ce-cli/bionic,now 5:19.03.4~3-0~ubuntu-bionic amd64 [installed,automatic]
  Docker CLI: the open-source application container engine

[email protected]:~# 

OK这就搞定了!

好啦这次就到这里了,我继续更新我的大脑啦!!!

原文地址:https://www.cnblogs.com/kuiyajia/p/11772589.html

时间: 2024-08-30 12:43:09

记一次Ubuntu19无法安装docker源的相关文章

解决Centos7安装docker源问题

根据官方文档:https://docs.docker.com/install/linux/docker-ce/centos/搭建docker? 1.卸载docker旧版本: sudo yum remove docker \? ? ? ? ? ? ? ? ? docker-client \? ? ? ? ? ? ? ? ? docker-client-latest \? ? ? ? ? ? ? ? ? docker-common \? ? ? ? ? ? ? ? ? docker-latest \

ubuntu19.10 安装 docker

ubuntu 安装docker 1.更新现有的包列表 sudo apt update 2.使用apt安装一些允许通过HTTPS才能使用的软件包: sudo apt install apt-transport-https ca-certificates curl software-properties-common 3.将官方Docker存储库的GPG密钥添加到您的系统: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo

kali安装开启ssh & 安装docker

ssh相关 一.配置SSH参数 1. 修改sshd_config文件,命令为: vi /etc/ssh/sshd_config 将#PasswordAuthentication no的注释去掉,并且将NO修改为YES //kali中默认是yes 2. 将PermitRootLogin without-password修改为 PermitRootLogin yes 3. 然后,保存,退出vim. 二.启动SSH服务 命令为: /etc/init.d/ssh start 或者 service ssh

配置docker官方源并用yum安装docker

一.docker的官方安装文档: https://docs.docker.com/engine/installation/linux/centos/ 由docker给的文档可以看出它也只是去配置了一个docker的yum源.然后就通过这个源来安装docker了:在这个文档下我们采用手工配置 的方式 二.配置一个docker用的源: 1.为docker 增加一个新的yum配置文件:touch /etc/yum.repos.d/docker.repo touch /etc/yum.repos.d/d

搭建本地 yum 源 离线安装 Docker 1.12.6

使用 yum 安装 docker ,需要访问互联网.有时内网环境的机器也需要安装docker.直接使用rpm 包安装需要解决各种各样的依赖,搭建本地yum 源是一个很好解决问题的方法. centos yum 命令 提供了一种只下载不安装的命令 . yum  --downloadonly   ,  --downloaddir=DLDIR  ,下面是构建的详细步骤 环境准备 选择一台可以连接外网的服务器.保证可以相应的软件安装包 下载docker 软件 mkdir -p /opt/docker/do

Centos7使用Docker安装Gogs源码git仓库

gihub地址:https://github.com/gogs/gogs gogs官网:https://gogs.io/ gihub官方docker安装gogs方法:https://github.com/gogs/gogs/tree/master/docker 我这边另外一篇centos7安装docker的文章:https://www.cnblogs.com/Sungeek/p/9182433.html 搭建环境:centos7+docker+git+Mariadb 最近公司内部需要搭建一个gi

Linux中修改docker镜像源及安装docker

1.首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 2.进入yum源配置文件所在的文件夹 cd /etc/yum.repos.d/ 3.下载163的yum源配置文件(CentOS7) wget http://mirrors.163.com/.help/CentOS7-Base-163.repo 清

CentOS7用阿里云Docker Yum源在线安装Docker

一.参考文档 官方Docker安装文档:https://docs.docker.com/install/linux/docker-ce/centos 阿里云Docker安装文档:https://yq.aliyun.com/articles/110806 二.安装步骤1.删除已安装的Docker # Uninstall installed docker sudo yum remove docker docker-client docker-client-latest docker-common d

centos7下安装docker 17.x

docker的17.X版本与以前的docker安装有些不同,参考了下这篇文章http://www.itmuch.com/docker/docker-2/,以下是我的docker 17.X版本安装过程,记下来,方便以后查阅 1.卸载老的版本docker: yum remove docker docker-common container-selinux docker-selinux docker-engine 执行该命令只会卸载Docker本身,而不会删除Docker内容,例如镜像.容器.卷以及网