yum & apt安装指定版本的软件包
### 列出包名的所有版本(仅当前系统yum源中包含的)
yum --showduplicates list PACKAGE | expand
### 安装指定版本
yum install <package name>-<version info>
Example:
[root@node1 ~]# yum --showduplicates list mysql | expand
Last metadata expiration check: 0:05:59 ago on Tue 26 Jul 2022 02:40:47 PM CST.
Available Packages
mysql.x86_64 8.0.26-1.module+el8.4.0+652+6de068a7 appstream
[root@node1 ~]# yum install mysql-8.0.26-1.module+el8.4.0+652+6de068a7
# 列出包名的所有版本(仅当前系统apt源中包含的)
apt-cache madison PACKAGE
# 安装指定版本
apt install <package name>=<version info>
Example:
root@node1:~# apt-cache madison nginx
nginx | 1.18.0-2~bionic | http://nginx.org/packages/ubuntu bionic/nginx amd64 Packages
nginx | 1.18.0-1~bionic | http://nginx.org/packages/ubuntu bionic/nginx amd64 Packages
nginx | 1.14.0-0ubuntu1.10 | http://cn.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
nginx | 1.14.0-0ubuntu1.10 | http://cn.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
nginx | 1.14.0-0ubuntu1 | http://cn.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
root@node1:~# apt install nginx=1.20.2-1~bionic