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

來源:本站原創 Linux 超過1,054 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

 

[[email protected] ~]$ 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.qdxgqk.live/ 版權所有。本站文章除注明出處外,皆為作者原創文章,可自由引用,但請注明來源。 禁止全文轉載。
本文鏈接:http://www.qdxgqk.live/?p=3776轉載請注明轉自CCIE那點事
如果喜歡:點此訂閱本站
  • 相關文章
  • 為您推薦
  • 各種觀點
?
暫時還木有人評論,坐等沙發!
發表評論

您必須 [ 登錄 ] 才能發表留言!

?
?
萌宠夺宝游戏