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
相关推荐
handler011 分钟前
【Linux】ELF、链接与动态库,程序装载全解析
linux·运维·服务器·chrome·c·elf·文件
dishugj9 分钟前
操作系统四大特征|软考架构师考点梳理
java·linux·服务器
梅梅绵绵冰12 分钟前
Docker容器化平台
docker·容器·eureka
Huangjin007_16 分钟前
【Linux 系统篇(十九)】进程(七):深入理解虚拟地址空间:从进程地址空间到内核管理
linux·运维·服务器
YIN_尹21 分钟前
【Linux系统编程】模拟实现一个最简版C语言标准IO库
linux·服务器·c语言
我是唐青枫37 分钟前
Docker diff 详解:看清容器里到底改了什么
docker·容器
aningx1 小时前
使用自定义bash脚本预防oom卡死 v2
linux
cjp5602 小时前
011. UG二次开发,UG管道通讯服务器与wpf客户端通讯
linux·运维·服务器
上官唐云3 小时前
2024届本科 | C++ Linux服务端开发求职:从嵌入式到底层服务端的技术之路(附开源项目+简历)
linux·c++·开源·求职招聘
Zucker n3 小时前
Ubuntu24.04结合ollama本地使用Hermes
linux·ubuntu