Wie konfiguriere ich yum für die Verwendung zusätzlicher Repositorys?

9988
GregH

Ich versuche, ein Paket zu installieren (z. B. python-mysqldb) und wenn ich versuche, eine yum-Installation durchzuführen, erhalte ich die Meldung "Kein Paket python-mysqldb avaialble". Ich gehe davon aus, dass das auf meiner RHEL-Box eingerichtete yum-Repository dieses Paket nicht enthält. Ich habe also zwei Fragen:

  1. Wie konfiguriere ich yum so, dass es in anderen Repositorys nachschaut?

  2. Wie finde ich das Repository mit dem Paket, das ich installieren möchte?

2

1 Antwort auf die Frage

5
Dion Pezzimenti

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: