1、卸载(之前安装的是docker-ce)
apt-get remove docker-ce docker-ce-cli
apt list --installed | grep docker
发现还有几个docker相关的,一并卸载
2、删除相关文件,不然新安装启动不了
cd /var/lib/dpkg/info ls | grep docker-ce | xargs rm
3、安装
照这个来一遍 https://docs.docker.com/engine/install/ubuntu/
4、如果没自动启动,提示:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon
systemctl daemon-reload systemctl restart docker
5、设置开机自启
systemctl enable docker
6、docker ps 发现之前的实例都在,而且运行正常
标签:daemon,ubuntu,ce,systemctl,卸载,docker From: https://www.cnblogs.com/dwj192/p/17117266.html