适用于 Ubuntu 20.04 22.04
卸载原版本
安装docker-ce社区版前,先卸载docker-desktop等原有版本
apt remove docker-desktop
apt autoremove
安装依赖包
让apt支持https
apt install apt-transport-https ca-certificates curl software-properties-common
添加GPG公钥
添加Docker官方库的GPG公钥到系统中
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
添加安装源
添加docker官方源
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
执行安装
更新软件包列表
apt update
查看并确认docker-ce软件包的信息
apt-cache policy docker-ce
执行安装
apt install docker-ce
运行启动
安装完成后,启动
systemctl start docker
文章作者:DOTATONG
发布日期:2023-11-08
评论