I have installed RHEL6 (Redhat Enterprised Linux 6) on my machine, its working fine and its just the thing I want. But, unlike Ubuntu or any other linux based OS (expect CentOS,its quite similar to RetHat), the updates from Redhat aren’t that easy to get. You have to be registered to RHN (RedHat Network) to get updates.
To install rpms or update any rpm we use “YUM” command. This command might be alittle new to many linux users but its a nice little command for Redhat (CentOS too) that basically handles all of the installing/uninstalling processes. The thing I love about Yum command is that it handles pretty much everything during installation like dependencies and all. Also you can use this command to update and even group install the defined packages.
Yum installs rpm located on a specific folder, where the user downloads and preserves all his rpms. This folder is configured to yum by specifying the path in
The basic format of the repo file is:
This configuration tells the yum commad to file the rpm from the specified path. Well, if you want to install, lets say, php5 on your machine, then unless there’s an rpm named so, you wont be able to install the desired rpm. Unlike in Ubuntu,
sudo apt-get install php5 will do the trick.
If you have RHEL6, then the updates after the release of OS wont be available to you unless you are configured to RHN.
So, what do we need to do? Well, the process it quite simple:
First you’ll have to download these two rpms: epel-release and remi-release.
You can get the epel-release for RHEL6 from the link
Download the file and install it using command as a root (in the folder containing the rpm):
rpm -Uvh epel-release-6-5.noarch.rpm
For the second one, you can download the remi-release for RHEL6 from the link
Download the file and install it using command as a root(in the folder containing the rpm):
rpm -Uvh remi-release-6.rpm
The order of install is necessary, because the installation of remi is dependent on epel release.
Now that you have installed remi, an new repo file will be created on
/etc/yum.repos.d/remi.repo.Now edit that file, and under
[remi] there is parameter called enabled. Change its value to 1 if its set to 0. This will activate the remi.repo file.
Now you will be able to install rpms without having to worry about (not almost but) pretty much everything.
Now, here is guide to install php5 in Redhat:
1. yum install php
Now, remi will search for php (latest version available) and install it using yum.
2. php -v
After the installation, this command will display you the version of php installed.
This will mark the completion of installation. So, there you go, now you should be able use yum command to install any rpm as required 🙂