How to uninstall and reinstall docker

王林
Release: 2020-08-26 15:55:16
forward
18961 people have browsed it

How to uninstall and reinstall docker

Specific steps:

(Recommended video tutorial:Docker video tutorial)

Uninstall the old version of docker before reinstalling

rpm list installed|grep docker
Copy after login

Or use this command

rpm -qa|grep docker //查看已经安装的docker安装包,列出入校内容 docker.x86_64 2:1.12.6-16.el7.centos @extras docker-client.x86_64 2:1.12.6-16.el7.centos @extras docker-common.x86_64 2:1.12.6-16.el7.centos @extra
Copy after login

Delete respectively

yum -y remove docker.x86_64 yum -y remove docker-client.x86_64 yum -y remove docker-common.x86_64
Copy after login

Delete the docker image

rm -rf /var/lib/docker
Copy after login

Reinstall

yum update //确保yum包最新
Copy after login
yum install -y yum-utils
Copy after login

(recommended related tutorials:docker tutorial)

Check whether there is device-mapper-persistent-data package (rpm -qa|grep device-mapper-persistent-data, if so) There is no need to install it). If it is not installed, execute the command:

yum install -y device-mapper-persistent-data
Copy after login

to check whether there is lvm2 package (rpm -qa|grep lvm2, if there is, there is no need to install it). If it is not installed, execute the command :

yum install -y lvm2
Copy after login
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo //注意,以上为设置yum源,从Docker官方地址下载安装包 yum list docker-ce --showduplicates | sort -r //查看仓库中所有的docker版本 yum install docker-ce(默认安装)或 yum install docker-ce-17.12.0.ce(注:17.12.0是版本号,可根据列表选择)
Copy after login

Set docker to automatically start and start services after booting up

[root@localhost softs]# systemctl enable docker [root@localhost softs]# systemctl start docker
Copy after login

The above is the detailed content of How to uninstall and reinstall docker. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!