How do I configure yum to use additional repositories?

9,888

To add a repository you need to add the key for the repository then install the repository. For this example I will use the El Repo since it has the commands you need to run:

http://elrepo.org/tiki/tiki-index.php

First you need to import the key using rpm --import:

rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org

Then you run rpm with the -Uvh switch to isntall the repo (there are two installations depending on what version of CentOS/RHEL your using).

RHEL 5/CentOS 5

rpm -Uvh http://elrepo.org/elrepo-release-5-4.el5.elrepo.noarch.rpm

RHEL 6/CentOS 6

rpm -Uvh http://elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm

The error your getting is showing that particular package doesn't exist. If you found on the internet that the package should be available you might want to inquire what type of repository is required to download it. It seems you just want Python and MySQL to be available. I think that MySQL is available with the default repositories.

Install MySQL & PHP:

 yum install mysql-server mysql php-mysql

Install Python:

 yum install python26

For python26 you will need the EPEL repository:

http://fedoraproject.org/wiki/EPEL http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x

The above links should be able to help you with getting the required repository for Python.

In general, you can also use RPM search engines to look for specific packages, download and install them using rpm -ivh downloaded_package.rpm. Some of the better known ones are:

Share:
9,888

Related videos on Youtube

GregH
Author by

GregH

Updated on September 18, 2022

Comments

  • GregH
    GregH almost 2 years

    I am trying to install a package (e.g. python-mysqldb) and when I try to do a yum install, I get a message that "No package python-mysqldb avaialble". I assume this is because the yum repository set up on my RHEL box does not contain this package. So I have two questions:

    1. How do I configure yum to look in other repositories?

    2. How do I locate the repository that has the package I want to install?