Install RPMForge repository in CentOS 6

RPMForge is one of the best known repository in Linux world. It is used to install third party softwares in RPM based distributions. It contains more than 5000 packages.

Install RPMForge repository in CentOS

The steps provided here are tested in CentOS 6.3 32 bit edition, though it will work on RHEL 6.x/Scientific Linux 6.x too.
First check your operating system version. Then download the relevent repository. To check OS version use “uname -a” command.
[root@mainserver ~]# uname -a
Linux mainserver.ostechnix.com 2.6.32-279.el6.i686 #1 SMP Fri Jun 22 10:59:55 UTC 2012 i686 i686 i386 GNU/Linux
To install Rpmforge repository for 32 bit use the following commands.
[root@mainserver ~]# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
--2013-01-31 15:40:06--  http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Resolving packages.sw.be... 78.46.17.228
Connecting to packages.sw.be|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm [following]
--2013-01-31 15:40:07--  http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Resolving pkgs.repoforge.org... 78.46.17.228
Connecting to pkgs.repoforge.org|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://rpmforge.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm [following]
--2013-01-31 15:40:09--  http://rpmforge.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Resolving rpmforge.sw.be... 78.46.17.228
Connecting to rpmforge.sw.be|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://tree.repoforge.org/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm [following]
--2013-01-31 15:40:10--  http://tree.repoforge.org/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Resolving tree.repoforge.org... 78.46.17.228
Connecting to tree.repoforge.org|78.46.17.228|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm [following]
--2013-01-31 15:40:12--  http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
Resolving apt.sw.be... 193.1.193.67
Connecting to apt.sw.be|193.1.193.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12732 (12K) [application/x-redhat-package-manager]
Saving to: `rpmforge-release-0.5.2-2.el6.rf.i686.rpm'
100%[======================================>] 12,732      9.60K/s   in 1.3s    
2013-01-31 15:40:15 (9.60 KB/s) - `rpmforge-release-0.5.2-2.el6.rf.i686.rpm' saved [12732/12732]
For 64 bit use the following command.
[root@mainserver ~]# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el4.rf.x86_64.rpm
[root@mainserver ~]# rpm -ivh rpmforge-release-0.5.2-2.el4.rf.x86_64.rpm
Then import the key and install RPMForge.
[root@mainserver ~]# rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
[root@mainserver ~]#  rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm
rpmforge-release-0.5.2-2.el6.rf.i686.rpm: (sha1) dsa sha1 md5 gpg OK
[root@mainserver ~]# rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm 
Preparing...                ########################################### [100%]
   1:rpmforge-release       ########################################### [100%]

Test RPMForge Repository

Now let us install a sample package to verify whether Rpmforge repository is working or not.
[root@mainserver ~]# yum install htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror-fpt-telecom.fpt.net
 * extras: mirror-fpt-telecom.fpt.net
 * rpmforge: mirror-fpt-telecom.fpt.net
 * updates: ftp.iitm.ac.in
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package htop.i686 0:1.0.2-1.el6.rf will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
 Package       Arch          Version                    Repository         Size
================================================================================
Installing:
 htop          i686          1.0.2-1.el6.rf             rpmforge           78 k
Transaction Summary
================================================================================
Install       1 Package(s)
Total download size: 78 k
Installed size: 186 k
Is this ok [y/N]: y
Downloading Packages:
htop-1.0.2-1.el6.rf.i686.rpm                             |  78 kB     00:01     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : htop-1.0.2-1.el6.rf.i686                                     1/1 
  Verifying  : htop-1.0.2-1.el6.rf.i686                                     1/1 
Installed:
  htop.i686 0:1.0.2-1.el6.rf                                                    
Complete!

Disable RPMForge Repository

To disable RPMForge repository navigate to /etc/yum.repos.d/, open the rpmforge.repo file and set enabled=0.
### Name: RPMforge RPM Repository for RHEL 6 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el6/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el6/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
Thats it. Have a good day.