转自:https://www.cnblogs.com/tangzz/p/11950126.html
![](https://img2020.cnblogs.com/blog/1529447/202007/1529447-20200727140628713-1950687039.png)
1.sudo apt-get remove docker.io docker-engine
2.sudo apt-get update
3.$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
4.# 官方源 $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - # 中科大源
$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add - # 清华源
$ curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# 检查秘钥是否安装成功
$ sudo apt-key fingerprint 0EBFCD88
5.