Skip to content
Home » Linux » How to Get the Newest Release of Packages on CentOS

How to Get the Newest Release of Packages on CentOS

With the original yum repo, you can only get the stablest version of packages like the following output:

[root@localhost ~]# cat /etc/centos-release
CentOS release 6.4 (Final)
[root@localhost ~]# yum info httpd
...
Available Packages
Name        : httpd
Arch        : x86_64
Version     : 2.2.15
...
[root@localhost ~]# yum info mysql
...
Available Packages
Name        : mysql
Arch        : x86_64
Version     : 5.1.69
...
[root@localhost ~]# yum info php
...
Available Packages
Name        : php
Arch        : x86_64
Version     : 5.3.3
...

The version of those packages are too early to catch up with the newest technology, for instance, the current version of MySQL is 5.6, but the version in repo is still 5.1.

The solution is to add another yum repo to make the packages more recent. In my case, I am going to add EPEL, REMI and CentALT as alternatives. To add these repos, you can install their rpms like this:

[root@localhost ~]# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
warning: /var/tmp/rpm-tmp.1rHXdd: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]
[root@localhost ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
warning: /var/tmp/rpm-tmp.PCaiOc: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
Preparing...                ########################################### [100%]
   1:remi-release           ########################################### [100%]
[root@localhost ~]# rpm -Uvh http://centos.alt.ru/repository/centos/6/x86_64/centalt-release-6-1.noarch.rpm
Retrieving http://centos.alt.ru/repository/centos/6/x86_64/centalt-release-6-1.noarch.rpm
warning: /var/tmp/rpm-tmp.JWqJYq: Header V3 DSA/SHA1 Signature, key ID e9bc4ae1: NOKEY
Preparing...                ########################################### [100%]
   1:centalt-release        ########################################### [100%]

Let's check the version of those packages again.

[root@localhost ~]# yum info httpd
...
Available Packages
Name        : httpd
Arch        : x86_64
Version     : 2.2.25
Release     : 1.el6
Size        : 886 k
Repo        : CentALT
...

[root@localhost ~]# yum --enablerepo=remi info mysql
...
Available Packages
Name        : mysql
Arch        : x86_64
Version     : 5.5.32
Release     : 1.el6.remi
Size        : 5.7 M
Repo        : remi
...

[root@localhost ~]# yum --enablerepo=remi,remi-test info php
...
Available Packages
Name        : php
Arch        : x86_64
Version     : 5.5.0
Release     : 2.el6.remi
Size        : 2.5 M
Repo        : remi-test
...

You can see the version of those packages are more recent than the packages from the official repo by CentOS.

Leave a Reply

Your email address will not be published. Required fields are marked *