How to: Enable and Install (updates/rmps) in RHEL6 without RHNs ?
Installing and Using yum
in RHEL6 Without RHN #
I recently installed RHEL6 (Red Hat Enterprise Linux 6) on my machine. It’s working perfectly and does exactly what I need. However, unlike Ubuntu or most Linux distributions (except CentOS, which is quite similar to Red Hat), getting updates in RHEL is not straightforward—you must be registered with RHN (Red Hat Network).
What is yum
? #
To install or update RPM packages in RHEL/CentOS, we use the yum
command. It’s a powerful tool that:
- Automatically handles dependencies
- Can install, update, or remove packages
- Supports group installation of packages
yum
uses repository files found in: /etc/yum.repos.d/[name].repo
Basic Format of a .repo
File #
[repo_name]
name=My Local Repo
baseurl=file://PATH_OF_YOUR_FOLDER
enabled=1
gpgcheck=0
This configuration tells yum
to search for .rpm
packages in the specified folder.
Unlike Ubuntu, where a simple
sudo apt-get install php5
would work, RHEL6 requires some setup if you’re not using RHN.
Getting Updates in RHEL6 Without RHN #
If you don’t have RHN access, you can still use external repositories like EPEL and Remi.
Step 1: Download Required .rpm
Files #
EPEL Release for RHEL6
Download from: EPEL for RHEL6
rpm -Uvh epel-release-6-5.noarch.rpm
Remi Release for RHEL6
Download from: Remi Repo
rpm -Uvh remi-release-6.rpm
Make sure to install epel-release first, since remi-release depends on it.
Step 2: Enable the Remi Repository #
After installation, a new repo file will be created: /etc/yum.repos.d/remi.repo
Edit it and make sure the [remi]
section has: ini enabled=1
This activates the Remi repository.
Installing PHP5 on RHEL6 #
Once your repositories are set up, installing PHP is easy: yum install php
This command will fetch the latest version of PHP available in the Remi repo.
Verify Installation: #
php -v
You should now see the installed version of PHP displayed.
By configuring external repositories like EPEL and Remi, you can keep your RHEL6 system up to date and install necessary software packages without needing an RHN subscription.