Unix (Linux and *BSD) » Distributions

ID #1005

How can I add more CentOS repositories?

After installing CentOS, your system has only a few repositories, therefore offering a limited range of applications. It is possible and easy to add more repositories that are unofficial but trusted by the community. By doing so, you will access a wide range or applications for your CentOS system.

You have two ways to add more Centos repositories:

  • Drop .repo files into your /etc/yum.repos.d/ directory
  • Add a repository entry in your /etc/yum.conf file

In this example, we will use yum.conf only, for more consistency.

Adding official CentOS repositories

Here is the list of official repository entries that you can add to your /etc/yum.conf file:

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
enabled=1

#released updates
[update]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
enabled=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
enabled=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
enabled=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

Additional third-party CentOS repositories

The following repositories don't belong to the CentOS project but are trustworthy and provide additional software:

[dries]
name=Extra Fedora rpms dries - $releasever - $basearch
baseurl=http://ftp.belnet.be/packages/dries.ulyssis.org/redhat/el4/en/i386/dries/RPMS
gpgcheck=1
enabled=1

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

[kbs-CentOS-Extras]
name=CentOS.Karan.Org-EL$releasever - Stable
gpgcheck=1
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
enabled=1
baseurl=http://centos.karan.org/el$releasever/extras/stable/$basearch/RPMS/

[kbs-CentOS-Misc]
name=CentOS.Karan.Org-EL$releasever - Stable
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
gpgcheck=1
enabled=1
baseurl=http://centos.karan.org/el$releasever/misc/stable/$basearch/RPMS/

[kbs-CentOS-Misc-Testing]
name=CentOS.Karan.Org-EL$releasever - Testing
gpgkey=http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
gpgcheck=1
enabled=1
baseurl=http://centos.karan.org/el$releasever/misc/testing/i386/RPMS/

[atrpms]
name=Fedora Core $releasever - $basearch - ATrpms
baseurl=http://dl.atrpms.net/fc$releasever-$basearch/atrpms/stable
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
gpgcheck=1enabled=1

To use the above repositories, you need to add their GPG key for authentication:

$ su -
# rpm --import http://centos.karan.org/RPM-GPG-KEY-karan.org.txt
# rpm --import http://dries.ulyssis.org/rpm/RPM-GPG-KEY.dries.txt
# rpm --import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
# rpm --import http://ATrpms.net/RPM-GPG-KEY.atrpms

With all these repositories, you should be able to find most applications you need.

Tags: -

Related entries:

Last update: 2006-09-29 15:59
Author: Charles A. Landemaine
Revision: 1.0

Digg it! Print this record Send to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this entry:

Average rating: 4.53 out of 5 (66 Votes )

completely useless 1 2 3 4 5 most valuable

You can comment on this entry

Comment of Jim Rolt:
th key for DAG is now wrong. The correct line is: # rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
Added at: 2007-02-19 09:59

Comment of Marlaina Barr:
I replaced the Dag repo file you have listed with the following (which works): [dag] name=Dag RPM Repository for Red Hat Enterprise Linux baseurl=http://dag.linux.iastate.edu/dag/redhat/el$releasever/en/$basearch/dag gpgcheck=1 enabled=1
Added at: 2007-03-11 14:15

Comment of Boyce Crownover:
Excellent reference, thank you. I am using CentOS 5 and ran into problems with both the Dag key and a couple of the ones at karan.org. I don't know whether it is because the information has changed or because they aren't supporting all the same paths for 5 yet. With karan I had to disable both the kbs-CentOS-Misc and kbs-CentOS-Misc-Testing. (Neither appears to be valid/available even with info from the site.) With dag I had to browse to the key and save the key, just the key and not the comments, as a text file then import it separately. All seems functional after those changes.
Added at: 2007-05-10 20:26

Comment of Billy:
For CentOS5 I needed to change the fc to el in the following line. baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable Billy
Added at: 2007-08-14 22:30