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
相关推荐
运维栈记1 小时前
API Error: 400 Request body format invalid
linux·ai
qq_452396231 小时前
第十篇:《Dockerfile 最佳实践与镜像瘦身》
docker
小白兔奶糖ovo1 小时前
【Leetcode】231. 2的幂
linux·算法·leetcode
Plastic garden2 小时前
Docker(1)
运维·docker·容器
s_w.h2 小时前
【 linux 】动静态库的制作
linux·运维·服务器·算法·bash
顺风尿一寸2 小时前
深入Linux内核:mkdir系统调用的完整实现解析
linux
用户2367829801682 小时前
Linux free 命令深度解析:从内存监控到 OOM 排查的完整指南
linux
gs801403 小时前
网络隐形杀手:从 Could not connect to SMTP host 报错深度剖析 Docker MTU 黑洞理论与实战
网络·docker·容器
无足鸟ICT3 小时前
【RHCA+】boxes命令(艺术框)
linux
_Voosk3 小时前
FreeBSD 使用代理运行命令
linux·运维·freebsd