Centos安装和卸载docker

owenzhang24 2021-02-23 17:35:03
docker CentOS docker-client


自己随便yum 安装了docker 安装了发现一直启动不了,一直报Failed to start docker.service: Unit not found. 这个错误,于是卸载重装,记录一下这个坑爹的过程

一、查看自己已经安装的docker

yum list installed |grep docker

输入后可以清楚的看到控制台会输出

[root@xxwlog docker]# yum list installed |grep docker
docker-client.x86_64 2:1.13.1-162.git64e9980.el7.centos
docker-common.x86_64 2:1.13.1-162.git64e9980.el7.centos

二、卸载已经安装的docker

yum -y remove docker-ce.x86_64

client会自动卸载掉如果没有卸载掉继续使用yum -y remove 卸载

再次输入 yum list installed |grep docker 查看是否删除成功

三、以正确的姿态安装docker

这里推荐使用Docker Engineshequ社区的存储库安装docker。所以在安装之前需要设置Docker存储库。之后,您可以从存储库安装和更新Docker。

3.1 安装存储库:

安装所需的包。yum-utils提供了yum-config-manager 效用,并device-mapper-persistent-datalvm2由需要 devicemapper存储驱动程序。

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

3.2设置稳定存储库yum源为阿里docker源

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

3.3 第一种安装方式 最新版本安装

sudo yum install -y docker-ce

安装完成后,请直接跳过3.4

3.4 特定版本安装

要安装特定版本的Docker Engine - Community,请列出repo中的可用版本,然后选择并安装

3.4.1列出可安装版本

yum list docker-ce --showduplicates | sort -r

3.4.2 安装指定版本

#从安装列表中指定版本17.09.0
yum install docker-ce-17.09.0.ce -y

3.5 启动并加入开启启动

sudo systemctl start docker
sudo systemctl enable docker

3.6 验证安装是否成功(有client和service两部分表示docker安装启动都成功了)

docker version

3.7 验证启动成功

docker ps -a

3.8 常用管理命令

#docker启动
sudo systemctl start docker

#设置开机自启动
sudo systemctl enable docker

#重启docker
sudo systemctl restart docker

#关闭docker
sudo systemctl stop docker

#查看是否启动成功
docker ps -a
版权声明
本文为[owenzhang24]所创,转载请带上原文链接,感谢
https://my.oschina.net/owenzhang24/blog/4960884

  1. 忘记云服务器上MySQL数据库的root密码时如何重置密码?
  2. Detailed explanation of lettuce, an advanced client of redis
  3. Springboot learning integrated application (1)
  4. Linux File Recover
  5. Linux-Security
  6. How to reset the password when you forget the root password of MySQL database on the cloud server?
  7. Linux File Recover
  8. Linux-Security
  9. LiteOS:盘点那些重要的数据结构
  10. Linux Memory
  11. Liteos: inventory those important data structures
  12. Linux Memory
  13. 手把手教你使用IDEA2020创建SpringBoot项目
  14. Hand in hand to teach you how to create a springboot project with idea2020
  15. spring boot 整合swagger2生成API文档
  16. Spring boot integrates swagger2 to generate API documents
  17. linux操作系统重启后 解决nginx的pid消失问题
  18. Solve the problem of nginx PID disappearing after Linux operating system restart
  19. JAVA版本号含义
  20. The meaning of java version number
  21. 开源办公开发平台丨Mysql5.7两套四节点主从结构环境搭建教程(二)
  22. 开源办公开发平台丨Mysql5.7两套四节点主从结构环境搭建教程(一)
  23. Open source office development platform mysql5.7 two sets of four node master-slave structure environment building tutorial (2)
  24. HTTP的“无状态”和REST的“状态转换”
  25. Open source office development platform mysql5.7 two sets of four node master-slave structure environment building tutorial (1)
  26. 【大数据哔哔集20210128】使用Hive计算环比和同比
  27. 【大数据哔哔集20210125】Kafka将逐步弃用对zookeeper的依赖
  28. 【大数据哔哔集20210124】有人问我Kafka Leader选举?我真没慌
  29. 【大数据哔哔集20210123】别问,问就是Kafka高可靠
  30. Spring 事务、异步和循环依赖有什么关系?
  31. Spring 动态代理时是如何解决循环依赖的?为什么要使用三级缓存?
  32. "Stateless" of HTTP and "state transition" of rest
  33. [big data bibiji 20210128] use hive to calculate month on month and year on year
  34. [big data bibiji 20210125] Kafka will gradually abandon its dependence on zookeeper
  35. [big data beeps 20210124] someone asked me about Kafka leader election? I'm not in a panic
  36. [big data bibiji 20210123] don't ask, ask is Kafka highly reliable
  37. jQuery Gantt Package 在Visual Studio中创建一个新的ASP.NET项目
  38. What is the relationship between spring transactions, asynchrony, and circular dependencies?
  39. How to solve circular dependency in spring dynamic proxy? Why use level 3 caching?
  40. Unicode码的二进制转换(Java)
  41. JAVA的函数式接口
  42. JAVA里的元祖类
  43. JQuery Gantt package to create a new ASP.NET project
  44. Binary conversion of Unicode code (Java)
  45. The functional interface of Java
  46. Yuanzu class in Java
  47. Java中的CPU占用高和内存占用高的问题排查
  48. HashMap连环问你能答出几道?
  49. IntelliJ IDEA 还能画思维导图,果然最强 IDE!
  50. java中的反射和代理
  51. Troubleshooting of high CPU and memory usage in Java
  52. How many questions can you answer?
  53. IntelliJ idea can also draw mind maps. It's really the strongest ide!
  54. Reflection and proxy in Java
  55. Java中的CPU占用高和内存占用高的问题排查
  56. Linux OOM(out of memory)
  57. mysql 自定义函数因参数名称报错
  58. Troubleshooting of high CPU and memory usage in Java
  59. Linux OOM(out of memory)
  60. MySQL user defined function error due to parameter name