How To Add And Configure Remi Repositories In Linux

The official packages shipped with enterprise Linux such as RHEL contain packages that are officially supported by Red Hat Inc. These are stable packages but these are not up to date. But sometimes you might require some latest packages for your web-based services and applications such as latest versions of MySQL and PHP. You can get these packages from some third party repositories. On such repository is "remi" repository. This article presents some methods to add remi repository to your system.

Remi RPM

The RPM package for remi repository will install the configuration files to your system. To configure your system for remi repository, you just need to install the "remi-release" RPM package. This will add the configuration file in /etc/yum.repos.d directory. But this package has a dependency, the epel-release package. So before installing remi-release, epel-release package should be installed. These can be downloaded from the following links:

http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

You can use "Wget" or your web browser to download these packages. Now, using RPM command, these packages can be installed:

$ rpm -ivh epel-release-5-4.noarch.rpm

$ rpm -ivh remi-release-5.rpm

The installation of remi-release package will create these two files in your system:

/etc/pki/rpm-gpg/RPM-GPG-KEY-remi
/etc/yum.repos.d/remi.repo

The first file contains GPG key for remi repository packages. The second file, i.e. /etc/yum.repos.d/remi.repo is the repository file for remi. If your repository is disabled by default, then you can enable it by changing the enabled=0 value to enabled=1. And if the base url value is commented, then remove the leading # to uncomment this line. This is how this file looks by default:

[remi] name=Les RPM de remi pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority

[remi-test] name=Les RPM de remi en test pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/test/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/test/mirror
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Download the repo file itself

Here is another method for configuring remi repository to your system. You can download the repo file itself using this link:

http://rpms.famillecollet.com/enterprise/remi.repo

Save this file in /etc/yum.repos.d directory. But make sure that this file is owned by the root user and the root group with 644 permissions. Run the following commands as root user to make sure that everything is okay:

$ chown root:root /etc/yum.repos.d/remi.repo

$ chmod 644 /etc/yum.repos.d/remi.repo

Manual configuration

If none of the above methods work for you, you can manually create /etc/yum.repos.d/remi.repo file. The minimum configuration parameters for this file are as follows:

[remi] name=Les RPM de remi pour Enterprise Linux $releasever - $basearch
baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=1
gpgcheck=0

Write these lines in your file and you are done configuring the repository. Clean the yum cache using:

$ yum clean all

And you are ready to use your repository. You can now check yum update using the below command:

$ yum check-update

About Raghu

Raghu is working as Linux Server Administrator in Acknown Technologies Pvt. Ltd. He has been using Linux from last 5 years. He completed his RHCE certification in 2009. He likes to read about Linux and other Open Source Technologies and write articles on these.

Author Archive Page

Have anything to say?

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

All comments are subject to moderation.