CentOS Linux Yum Docker安装与升级

官网安装:https://docs.docker.com/engine/install/centos/#install-using-the-repository

卸载旧版

powershell 复制代码
# 停止docker
systemctl stop docker
# 卸载docker
yum remove docker \
	docker-client \
	docker-client-latest \
	docker-common \
	docker-latest \
	docker-latest-logrotate \
	docker-logrotate \
	docker-engine
或
yum remove docker*
  • yum可能会报告您没有安装这些包。
  • /var/lib/docker/卸载 Docker 时,存储的图像、容器、卷和网络不会被自动删除

查看可用版本

powershell 复制代码
yum list docker-ce --showduplicates | sort -r

docker-ce.x86_64    3:26.1.3-1.el9    docker-ce-stable
docker-ce.x86_64    3:26.1.2-1.el9    docker-ce-stable

官网版本说明个人没看明白,此处个人的理解:
3:26.1.3-1.el9 冒号前面3代表docker-ce 和 docker-ce-cli 用于区分不同的包,26.1.3-1.el9 是实际版本。

安装Docker

bash 复制代码
yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-buildx-plugin docker-compose-plugin
# 个人没有安装:docker-buildx-plugin docker-compose-plugin
yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
# 示例
yum install docker-ce-26.1.2-1.el9 docker-ce-cli-26.1.2-1.el9 containerd.io

启动

bash 复制代码
systemctl start docker
相关推荐
孤寂大仙v16 分钟前
【Linux笔记】——Linux线程理解与分页存储的奥秘
linux·运维·笔记
有谁看见我的剑了?1 小时前
ubuntu 22.04 wifi网卡配置地址上网
linux·运维·ubuntu
格桑阿sir1 小时前
Kubernetes控制平面组件:Kubelet详解(三):CRI 容器运行时接口层
docker·kubernetes·containerd·kubelet·cri-o·容器运行时·cri
码农新猿类1 小时前
Ubuntu摄像头打开失败
linux·运维·ubuntu
PWRJOY2 小时前
Ubuntu磁盘空间分析:du命令及常用组合
linux·运维·ubuntu
ASDyushui2 小时前
Shell 编程之正则表达式与文本处理器
linux·正则表达式
zuozewei2 小时前
安全扫描之 Linux 杀毒软件 Clamav 安装
linux·运维·安全
wangchen_02 小时前
linux-信号保存和处理
linux·运维·服务器
Eric.Lee20212 小时前
conda 输出指定python环境的库 输出为 yaml文件
linux·python·conda
z人间防沉迷k3 小时前
互联网协议的多路复用、Linux系统的I/O模式
linux·网络·http