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
相关推荐
绘梨衣5474 分钟前
Docker+FastAPI+MySQL 项目部署报错汇总
mysql·docker·fastapi
cui_ruicheng16 分钟前
Linux进程间通信(三):System V IPC与共享内存
linux·运维·服务器
蚰蜒螟28 分钟前
深入 Linux 内核同步机制:从 futex 到 spinlock 的完整旅程
linux·windows·microsoft
运维全栈笔记30 分钟前
Linux安装配置Tomcat保姆级教程:从部署到性能调优
linux·服务器·中间件·tomcat·apache·web
dllmayday2 小时前
Linux 上用终端连接 WiFi
linux·服务器·windows
百年੭ ᐕ)੭*⁾⁾3 小时前
docker使用neo4j
docker·容器·neo4j
峥无3 小时前
Linux系统编程基石:静态库·动态库·ELF文件·进程地址空间全景图
linux·运维·服务器
用户2367829801683 小时前
从 chmod 755 说起:Unix 文件权限到底是怎么算的?
linux
Strugglingler3 小时前
【systemctl 学习总结】
linux·systemd·systemctl·journalctl·unit file
春风有信4 小时前
【2026.05.01】Windows10安装Docker Desktop 4.71.0.0步骤及问题解决
运维·docker·容器