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 小时前
慢就是快12-12手动抛出异常
java·linux·前端
KING-WU5122 小时前
Linux 工具之Make 与 Makefile
java·linux·服务器
Lsetea2 小时前
OpenSSL报certificate is not yet valid:error 9与notBefore时间排查
linux·运维·https·ssl证书·openssl
魔法阵维护师3 小时前
Linux 命令行入门踩坑记录:从 VMware 装系统到文件管理
linux·运维·服务器
姜鱼问生3 小时前
docker exec 排查容器问题:从日志到进程
运维·网络·数据库·docker·容器
Apipi*3 小时前
30天速通Linux 第七章进程间通信
linux·运维·服务器
emo_2b3 小时前
Pycharm配置conda解释器时遇到的问题及解决方法
linux·pycharm·conda
人生百态,人生如梦4 小时前
Ubuntu在低版本下使用ccswitch+claudecode(CCSwitch+Docker+Claude)连调教程
linux·ubuntu·docker·claudecode·ccswitch
程序员老赵4 小时前
Docker 部署 OpenViking:轻松搭建 AI Agent 上下文数据库平台
docker·开源·agent
byte轻骑兵4 小时前
【BlueZ】hciconfig 工具:蓝牙适配器管理实操 + 源码实现基础
linux·bluez·电脑蓝牙·嵌入式蓝牙