Installing CentOS packages on Red Hat Enterprise Linux

At the weekend I got into a discussion with Andy Stanford-Clark and Richard Appleby on Twitter troubleshooting basic application installation in Red Hat Enterprise Linux (like Pidgin). Not finding a solution later began to plague me, I grabbed a copy of RHEL and installed it on a Virtual Machine to solve the problem. If you’re interested in the history of the Red Hat-based distributions, please see my other article.

 

Are you registered to the Red Hat Network (RHN)?

If not, you will see messages like this when trying to use the “yum” package installer.

[root@localhost ~]# yum install pidgin
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package pidgin available.
Nothing to do
[root@localhost ~]#

 

Don’t panic, you might be able to use CentOS packages

First you need to add the CentOS repository, create this file using your favorite text editor:

[root@localhost ~]# vi /etc/yum.repos.d/centos.repo

Adding the following contents, note the ‘5’ has to be hardcoded to either 5 or 6 depending on your RHEL version.

[centos]
name=CentOS $releasever - $basearch
baseurl=http://ftp.heanet.ie/pub/centos/5/os/$basearch/
enabled=1
gpgcheck=0

Once you’ve completed this step, you can now use “yum” to install CentOS packages.

 

Installing a package from CentOS

Here we’re installing the popular IM client Pidgin from the CentOS repository:

[root@localhost ~]# yum install pidgin
Loaded plugins: rhnplugin, security
Repository centos is listed more than once in the configuration
This system is not registered with RHN.
RHN support will be disabled.
centos | 1.1 kB 00:00
centos/primary | 967 kB 00:03
centos 2725/2725
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package pidgin.i386 0:2.6.6-5.el5_7.4 set to be updated
--> Processing Dependency: libpurple = 2.6.6-5.el5_7.4 for package: pidgin
--> Processing Dependency: libgtkspell.so.0 for package: pidgin
--> Processing Dependency: libpurple.so.0 for package: pidgin
--> Running transaction check
---> Package gtkspell.i386 0:2.0.11-2.1 set to be updated
---> Package libpurple.i386 0:2.6.6-5.el5_7.4 set to be updated
--> Processing Dependency: libmeanwhile.so.1 for package: libpurple
--> Processing Dependency: cyrus-sasl-md5 for package: libpurple
--> Processing Dependency: libsilcclient-1.0.so.1 for package: libpurple
--> Processing Dependency: libsilc-1.0.so.2 for package: libpurple
--> Running transaction check
---> Package cyrus-sasl-md5.i386 0:2.1.22-5.el5_4.3 set to be updated
--> Processing Dependency: cyrus-sasl-lib = 2.1.22-5.el5_4.3 for package: cyrus-sasl-md5
---> Package libsilc.i386 0:1.0.2-2.fc6 set to be updated
---> Package meanwhile.i386 0:1.0.2-5.el5 set to be updated
--> Running transaction check
--> Processing Dependency: cyrus-sasl-lib = 2.1.22-5.el5 for package: cyrus-sasl-plain
--> Processing Dependency: cyrus-sasl-lib = 2.1.22-5.el5 for package: cyrus-sasl
---> Package cyrus-sasl-lib.i386 0:2.1.22-5.el5_4.3 set to be updated
--> Running transaction check
---> Package cyrus-sasl.i386 0:2.1.22-5.el5_4.3 set to be updated
---> Package cyrus-sasl-plain.i386 0:2.1.22-5.el5_4.3 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===================================
Package Arch Version Repository Size
===================================
Installing:
pidgin i386 2.6.6-5.el5_7.4 centos 1.5 M
Installing for dependencies:
cyrus-sasl-md5 i386 2.1.22-5.el5_4.3 centos 46 k
gtkspell i386 2.0.11-2.1 centos 30 k
libpurple i386 2.6.6-5.el5_7.4 centos 8.3 M
libsilc i386 1.0.2-2.fc6 centos 412 k
meanwhile i386 1.0.2-5.el5 centos 108 k
Updating for dependencies:
cyrus-sasl i386 2.1.22-5.el5_4.3 centos 1.2 M
cyrus-sasl-lib i386 2.1.22-5.el5_4.3 centos 127 k
cyrus-sasl-plain i386 2.1.22-5.el5_4.3 centos 27 k

Transaction Summary
===================================
Install 6 Package(s)
Update 3 Package(s)
Remove 0 Package(s)

Total download size: 12 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): cyrus-sasl-plain-2.1.22-5.el5_4.3.i386.rpm | 27 kB 00:00
(2/9): gtkspell-2.0.11-2.1.i386.rpm | 30 kB 00:00
(3/9): cyrus-sasl-md5-2.1.22-5.el5_4.3.i386.rpm | 46 kB 00:00
(4/9): meanwhile-1.0.2-5.el5.i386.rpm | 108 kB 00:00
(5/9): cyrus-sasl-lib-2.1.22-5.el5_4.3.i386.rpm | 127 kB 00:00
(6/9): libsilc-1.0.2-2.fc6.i386.rpm | 412 kB 00:00
(7/9): cyrus-sasl-2.1.22-5.el5_4.3.i386.rpm | 1.2 MB 00:00
(8/9): pidgin-2.6.6-5.el5_7.4.i386.rpm | 1.5 MB 00:00
(9/9): libpurple-2.6.6-5.el5_7.4.i386.rpm | 8.3 MB 00:04
------------------------------------------------------
Total 1.3 MB/s | 12 MB 00:08
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : cyrus-sasl-lib 1/12
Updating : cyrus-sasl-plain 2/12
Updating : cyrus-sasl 3/12
Installing : cyrus-sasl-md5 4/12
Installing : libsilc 5/12
Installing : gtkspell 6/12
Installing : meanwhile 7/12
Installing : libpurple 8/12
Installing : pidgin 9/12
Cleanup : cyrus-sasl 10/12
Cleanup : cyrus-sasl-plain 11/12
Cleanup : cyrus-sasl-lib 12/12

Installed:
pidgin.i386 0:2.6.6-5.el5_7.4

Dependency Installed:
cyrus-sasl-md5.i386 0:2.1.22-5.el5_4.3 gtkspell.i386 0:2.0.11-2.1 libpurple.i386 0:2.6.6-5.el5_7.4 libsilc.i386 0:1.0.2-2.fc6
meanwhile.i386 0:1.0.2-5.el5

Dependency Updated:
cyrus-sasl.i386 0:2.1.22-5.el5_4.3 cyrus-sasl-lib.i386 0:2.1.22-5.el5_4.3 cyrus-sasl-plain.i386 0:2.1.22-5.el5_4.3

Complete!
[root@localhost ~]#

 

Misson Accomplished!

You now have a working version of Pidgin with its dependencies courtesy of CentOS.

33 thoughts on “Installing CentOS packages on Red Hat Enterprise Linux”

  1. Mike, thanks for this info. I changed my ‘centos.repo’ file to access the CentOS main mirror site instead. Change the release version number “6.3” as per your system.

    [centos]
    name=CentOS $releasever – $basearch
    baseurl=http://mirror.centos.org/centos/6.3/os/$basearch/
    enabled=0
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/6.3/os/$basearch/RPM-GPG-KEY-CentOS-6

    then install pidgin –
    # yum –enablerepo=centos install pidgin

    1. Josh Golden

      Thanks so much! I was able able to install TigerVNC server using this method on RHEL 6.6 x86_64. Just changed the 6.3 to 6.6.

  2. I am still getting error

    [root@supportlinux /]# yum install pidgin
    Loaded plugins: refresh-packagekit, rhnplugin
    This system is not registered with RHN.
    RHN support will be disabled.
    REDHAT | 3.7 kB 00:00 …
    REDHAT/primary_db | 2.9 MB 00:00 …
    centos | 3.7 kB 00:00
    centos/primary_db | 4.5 MB 00:11
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmfusion-free. Please verify its path and try again
    [root@supportlinux /]#

  3. Awesome Mike. I just took a redhat training and they gave us iso files to play with, but no subscriptions so this is very very helpful.

  4. Eric Mendes

    I’ve used this a few times and thought I’d give a thanks for the info! Quick and easy, thanks!

  5. Pingback: How To Fix Red Hat Error Resolving Dependencies in Windows

  6. Nrithya Kanaks

    Mike, Thank you soooo much.. i was spending hours to get around the problem !!

  7. Pingback: Unix/Linux:Problems installing R on Red Hat 6, requires libjpeg.so.62 – Unix Questions

  8. It made things simple for me to install tomcat on RHEL6 from centos repository. Thanks a lot for this article

  9. Illya Moskvin

    You are a life-saver. I inherited an old RHEL system with a long-expired subscription, and this helped fix things for sure. After configuring centos.repo, if you are still having trouble, try running “yum clean all” to reset the cache.

  10. Ilhem Hamdi

    Thank you very much ,
    I have been for days trying to make my repository on red hat works .
    Now it does thank you 😀

  11. Arun Shukla

    Thanks a lot for this post!
    I am new to Linux. I struggled for hours to yum install git without subscription to RHN.

    Keep doing the deed!

  12. This did not work for me – the url failed. What I found that does work is all of the above using:

    baseurl=http://vault.centos.org/5.11/os/$basearch/

    This is pointed to by the centos repos.

Leave a Comment

Your email address will not be published.

Scroll to Top