- 卸载旧的docker版本apt-get remove docker docker-engine docker.io containerd runc
- 更新软件列表apt-get update
- .允许apt命令可以使用HTTPS访问Docker repositoryapt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
- 添加Docker官方的GPG keycurl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- 设置repository版本为stableadd-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- 更新软件列表apt-get update
- 安装Docker CE和containerdapt-get install docker-ce docker-ce-cli containerd.io
- 查看版本信息docker --version