概述
本文将详细介绍在工作中碰到的docker卸载问题进行阐述内容如下:
docker 卸载不干净
例如:
官网介绍docker卸载的方法一般为
1> yum remove docker-ce -y
2> rm -fr /var/lib/docker*
但试过后你依然无法安装新版本,尤其是高版本降到低版本docker,问题在于docker你并没有卸载干净
正确的卸载方法如下:
1> yum list installed|grep docker 查看
2> yum remove [docker名称]
注:上述命令可以查询到未删除干净的docker残留,一般这种情况出现于docker 18.09.3版本上
示例:
[root@k8s-node02 k8s]# yum list installed|grep docker
containerd.io.x86_64 1.2.5-3.1.el7 @docker-ce-stable
docker-ce.x86_64
3:18.09.4-3.el7
@docker-ce-stable
docker-ce-cli.x86_64
1:18.09.4-3.el7
@docker-ce-stable
[root@k8s-node02 k8s]# yum remove docker-ce.x86_64
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:18.09.4-3.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
Removing:
docker-ce x86_64 3:18.09.4-3.el7 @docker-ce-stable 81 M
Transaction Summary
Remove 1 Package
Installed size: 81 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
/usr/bin/dockerd has not been configured as an alternative for dockerd
Erasing : 3:docker-ce-18.09.4-3.el7.x86_64 1/1
Verifying : 3:docker-ce-18.09.4-3.el7.x86_64 1/1
Removed:
docker-ce.x86_64 3:18.09.4-3.el7
Complete!
[root@k8s-node02 k8s]# yum remove docker-ce-cli.x86_64
Loaded plugins: fastestmirror, langpacks
Resolving Dependencies
--> Running transaction check
---> Package docker-ce-cli.x86_64 1:18.09.4-3.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
Removing:
docker-ce-cli x86_64 1:18.09.4-3.el7 @docker-ce-stable 66 M
Transaction Summary
Remove 1 Package
Installed size: 66 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : 1:docker-ce-cli-18.09.4-3.el7.x86_64 1/1
Verifying : 1:docker-ce-cli-18.09.4-3.el7.x86_64 1/1
Removed:
docker-ce-cli.x86_64 1:18.09.4-3.el7
Complete!
[root@k8s-node02 k8s]#
[root@k8s-node02 k8s]#
[root@k8s-node02 k8s]#
[root@k8s-node02 k8s]# ls
flannel.sh flannel-v0.11.0-linux-amd64.tar.gz README.md
[root@k8s-node02 k8s]#
[root@k8s-node02 k8s]# docker version
-bash: /usr/bin/docker: No such file or directory
查看版本在安装
[root@k8s-node02 k8s]# yum list docker-ce.x86_64 --showduplicates|sort -r
- updates: mirrors.huaweicloud.com
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror, langpacks - extras: mirrors.163.com
docker-ce.x86_64 3:18.09.5-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.4-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.3-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.2-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.1-3.el7 docker-ce-stable
docker-ce.x86_64 3:18.09.0-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.3.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.2.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.1.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable
docker-ce.x86_64 18.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 18.03.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.12.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.09.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.06.0.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.3.ce-1.el7 docker-ce-stable
docker-ce.x86_64 17.03.2.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.1.ce-1.el7.centos docker-ce-stable
docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable - base: mirrors.huaweicloud.com
Available Packages
[root@k8s-node02 k8s]# yum install docker-ce-18.09.0-3.el7 -y # 此处需要去除3:,不然是无法安装的
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile - base: mirrors.huaweicloud.com
- extras: mirrors.163.com
- updates: mirrors.huaweicloud.com
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 3:18.09.0-3.el7 will be installed
--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-18.09.0-3.el7.x86_64
--> Running transaction check
---> Package docker-ce-cli.x86_64 1:18.09.5-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================================================================================
Package Arch Version Repository Size
Installing:
docker-ce x86_64 3:18.09.0-3.el7 docker-ce-stable 19 M
Installing for dependencies:
docker-ce-cli x86_64 1:18.09.5-3.el7 docker-ce-stable 14 M
Transaction Summary
Install 1 Package (+1 Dependent package)
Total download size: 33 M
Installed size: 147 M
Downloading packages:
(1/2): docker-ce-cli-18.09.5-3.el7.x86_64.rpm | 14 MB 00:00:02
(2/2): docker-ce-18.09.0-3.el7.x86_64.rpm | 19 MB 00:00:03
Total 9.4 MB/s | 33 MB 00:00:03
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:docker-ce-cli-18.09.5-3.el7.x86_64 1/2
Installing : 3:docker-ce-18.09.0-3.el7.x86_64 2/2
Verifying : 1:docker-ce-cli-18.09.5-3.el7.x86_64 1/2
Verifying : 3:docker-ce-18.09.0-3.el7.x86_64 2/2
Installed:
docker-ce.x86_64 3:18.09.0-3.el7
Dependency Installed:
docker-ce-cli.x86_64 1:18.09.5-3.el7
Complete!
启动docker
[root@k8s-node02 k8s]# systemctl start docker
查看docker
[root@k8s-node02 k8s]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c26df78ca551 busybox "sh" 2 weeks ago
转载于:https://blog.51cto.com/8593714/2366834
最后
以上就是忧心外套为你收集整理的关于docker无法卸载问题本文将详细介绍在工作中碰到的docker卸载问题进行阐述内容如下:示例:================================================================================Package Arch Version Repository SizeTransaction Summary=================================================================的全部内容,希望文章能够帮你解决关于docker无法卸载问题本文将详细介绍在工作中碰到的docker卸载问题进行阐述内容如下:示例:================================================================================Package Arch Version Repository SizeTransaction Summary=================================================================所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复