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

root@ubuntu:~# 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安装包,还是无法安装:

root@uduntu:~# 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.
root@uduntu:~# apt search docker-ceroot@uduntu:~#

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

解决方法:

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

deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable//然后下载安装相关密钥curl -fsSL http://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

更新apt源:

root@uduntu:~# 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... Doneroot@uduntu:~#

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

root@uduntu:~# 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

root@uduntu:~# 

OK这就搞定了!

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

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

  1. kali安装开启ssh & 安装docker

    ssh相关 一.配置SSH参数 . 修改sshd_config文件,命令为: vi /etc/ssh/sshd_config 将#PasswordAuthentication no的注释去掉,并且将N ...

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

        参考文档 安装步骤 删除已安装的Docker 配置阿里云Docker Yum源 安装指定版本 启动Docker服务 参考文档 官方Docker安装文档:https://docs.docker. ...

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

    一.docker的官方安装文档: https://docs.docker.com/engine/installation/linux/centos/ 由docker给的文档可以看出它也只是去配置了一个 ...

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

    一.参考文档 官方Docker安装文档:https://docs.docker.com/install/linux/docker-ce/centos 阿里云Docker安装文档:https://yq. ...

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

    1.首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.re ...

  6. centos7 安装docker(手动和脚本安装)换源 卸载

    centos7 安装docker(手动和脚本安装)换源 卸载 Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker ...

  7. [Linux] - Manjaro ARM 系统配置(更新镜像源,安装 Docker 和 Dotnet Core)

    硬件:Raspberry Pi 4B系统:Manjaro-ARM-xfce-rpi4-19.08网址:https://manjaro.org/ Issue系统启动后,中文字符显示为小方格乱码 解决:安 ...

  8. 【从零开始搭建K8S】【第一篇】CentOS7.6离线安装Docker(手动安装以及基于yum本地源安装)

    下载CentOS7.6以及最小化安装CentOS7.6版本.由于CentOS属于开源软件,在国内也有很多的mirror站点可供下载,我选择的是华为站点进行下载:http://mirrors.huawe ...

  9. CentOS7使用阿里云源安装Docker

    安装步骤 1.删除已安装的Docker # Uninstall installed docker sudo yum remove docker \ docker-client \ docker-cli ...

随机推荐

  1. 前台get传递含中文数据到后台出现中文乱码

    博客:(前后台文件编码相同)前台传后台中文乱码 4月4日补充 jsp页面第一句没有下面一句或者页面发布后查看源代码时第一句已经不在了 <%@ page language="java&q ...

  2. 常见面试题之*args

    这个地方理解即可,只是面试的时候会被问到,单独做了一下知识点的整理,不推荐使用. def self_max(a,b,c,d,e,f,g,h,k,x=1,y=3,z=4): #默认参数 print(a, ...

  3. java8-date和timeAPI

    一 我们为什么要学习 java.timeAPI 原先的Date and Calendar 类的api比较复杂,不易于理解,应用起来不是很灵活. Calendar 是个线程不安全的类会导致SimpleD ...

  4. java8-StreamAPI之collection归约操作

    一说明 经过前一篇的StreamAPI学习,基本的流操作我相信大家都熟练于心了,那么今天是要详细解析一下收集器(collect)这么API 前提要区分,collect(StreamAPI)与coll ...

  5. Dubbo简介与基本概念

    场景 分布式系统的发展演变以及RPC简介: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/103555049 Dubbo简介 Ap ...

  6. 关于Redis 二进制内容的 可视化尝试

    二进制内容的 能否可视化?  网上的资料比较少啊! -------------------------------------------------------------------------- ...

  7. java8-Optional的引入

    背景 NPE问题,100%的Java程序员都碰到,并且曾经是心中的痛. 1965年英国TonyHoare引入了Null引用,后续的设计语言包括Java都保持了这种设计. 一个例子 业务模型 Perso ...

  8. XNginx升级记录

    之前的博文提到过,XNginx - nginx 集群可视化管理工具, 开发完成后一直稳定运行,直到前面因为一个站点的proxy站点配置问题,导致需要修改nginx 配置文件模板,因此借此机会对系统做了 ...

  9. Exceptionless应用--自定义插件

    遇到的问题/需求 这里会把一些敏感的参数记录下来,我们需要屏蔽掉,如图 我们希望日志里面有当前登录用户的信息,如图: 处理方法 tip:这里用的是.net非.net core 第一个问题(屏蔽敏感参数 ...

  10. 如何用python查看自己的电脑有几个核

    今天在研究多进程的时候,如果想要充分利用多核CPU资源,最起码的一点你应该知道自己的电脑有几个核. 下面是用python3 的 os 模块来查看自己的电脑是几个核的方法. import os prin ...