一看必会系列:yum 安装老版本或指定版本的包 — CCIE那点事

一看必会系列:yum 安装老版本或指定版本的包

来源:本站原创 Linux 超过68 views围观 0条评论

 

第一步,导入老版本源

[mariadb]
name = MariaDB-5.5.39
baseurl=https://downloads.mariadb.com/files/MariaDB/mariadb-5.5.39/yum/rhel6-amd64/
# alternative: baseurl=http://archive.mariadb.org/mariadb-5.5.39/yum/rhel6-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
 
将以上内容写入 /etc/yum.repo.d/mariadbxx.repo
 
yum makecache

 

[admin@centos73-amd64 ~]$ yum list –showduplicates MariaDB-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.mirrors.ovh.net
* extras: centos.mirrors.ovh.net
* updates: centos.mirrors.ovh.net
Available Packages
MariaDB-server.x86_64                10.1.31-1.el7.centos                mariadb
MariaDB-server.x86_64                10.1.32-1.el7.centos                mariadb
mariadb-server.x86_64                1:5.5.56-2.el7                      base
  
The MariaDB repository in this example contains MariaDB 10.1.31 and MariaDB 10.1.32. There is also MariaDB 5.5.56 in the CentOS base repository.

To install an older version of a package instead of the latest version we just need to specify the package name, a dash, and then the version number. And we only need to specify enough of the version number for it to be unique from the other available versions. So for this example, MariaDB-server-10.1.31 will work.

However, when installing an older version of a package, yum will automatically choose the latest versions of other dependent packages that it installs along side it, so to ensure that all MariaDB packages are on the same version it is necessary to specify them all when we install. The dependent packages installed when the MariaDB-server package is installed are: MariaDB-client, MariaDB-shared, and MariaDB-common, so to install MariaDB 10.1.31 from this repository, we would do the following:

sudo yum install MariaDB-server-10.1.31 MariaDB-client-10.1.31 MariaDB-shared-10.1.31 MariaDB-common-10.1.31

 

yum install  包的名字-版本号

 

完成

The rest of the install and setup process is as normal.

文章出自:CCIE那点事 http://www.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文链接:http://www.jdccie.com/?p=3776转载请注明转自CCIE那点事
如果喜欢:点此订阅本站
  • 相关文章
  • 为您推荐
  • 各种观点

暂时还木有人评论,坐等沙发!
发表评论

快捷键:Ctrl+Enter