1 删除旧版本
bash
$ docker remove -y docker
2 安装
- 安装最新版本
bash
$ yum list docker
Available Packages
docker.x86_64 25.0.3-1.amzn2023.0.1 @amazonlinux
$ yum -y install docker
$ yum list dodcker
Installed Packages
docker.x86_64 25.0.3-1.amzn2023.0.1 amazonlinux
- 安装指定版本
bash
$ yum list docker --showduplicate | sort -r
docker.x86_64 25.0.3-1.amzn2023.0.1 amazonlinux
docker.x86_64 24.0.5-1.amzn2023.0.3 amazonlinux
docker.x86_64 24.0.5-1.amzn2023.0.2 amazonlinux
docker.x86_64 24.0.5-1.amzn2023.0.1 amazonlinux
docker.x86_64 20.10.25-1.amzn2023.0.1 amazonlinux
docker.x86_64 20.10.23-1.amzn2023.0.1 amazonlinux
docker.x86_64 20.10.17-1.amzn2023.0.6 amazonlinux
docker.x86_64 20.10.17-1.amzn2023.0.5 amazonlinux
$ yum -y install docker-20.10.25-1.amzn2023.0.1
$ yum list docker
Installed Packages
docker.x86_64 20.10.25-1.amzn2023.0.1 @amazonlinux
Available Packages
docker.x86_64 25.0.3-1.amzn2023.0.1 amazonlinux