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
相关推荐
omnibots1 小时前
瑞萨SDK编译linux时,make menuconfig报错
linux·服务器·前端·嵌入式硬件
Java 码农1 小时前
linux shell 数组
linux·运维·服务器
大梦谁先觉i1 小时前
Linux 磁盘空间“消失”之谜:文件已删,空间却不释放?
linux·运维·服务器
序属秋秋秋1 小时前
《Linux系统编程之开发工具》【编译器 + 自动化构建器】
linux·运维·服务器·c语言·c++·自动化·编译器
带土11 小时前
32. 文件IO (3) 文件缓冲区与同步机制
linux
打不了嗝 ᥬ᭄2 小时前
传输层协议UDP
linux·网络·网络协议·udp
小涂2 小时前
在Linux(deepin-community-25)下安装MongoDB
linux·运维·mongodb
洛克大航海2 小时前
Linux 中如何查看系统的位数
linux·ubuntu
艾莉丝努力练剑2 小时前
【Linux基础开发工具 (一)】详解Linux软件生态与包管理器:从yum / apt原理到镜像源实战
linux·运维·服务器·ubuntu·centos·1024程序员节
illuspas2 小时前
Ubuntu 24.04下编译支持ROCm加速的llama.cpp
linux·ubuntu·llama