Repos

Applicable to Centos Versions:

  • Centos 5.x
  • Centos 6.x

Main Repository Divisions

Main software repositories:

  1. Official Centos Repositories (Section 1)
  2. 3rd Party Repositories (Section 2)

Section 1

A repository is a prepared directory or web site that contains software packages and index files. Software management utilities such as yum automatically locate and obtain the correct RPM packages from these repositories. This method frees you from having to manually find and install new applications or updates. You may use a single command to update all system software, or search for new software by specifying criteria. All of the software provided by the Centos Project is open source software. You may download and install software from the Centos Project network of repositories on as many systems as desired. The configuration files for these repositories can be found on the system here: /etc/yum.repos.d/*.repo

Official Centos Repos

  1. Base Repository:
  2. [Base] - The packages that make up Centos, as it is released on the ISOs. It is enabled by default.
  3. Updates Repository:
  4. [Updates] - Updated packages to [Base] released after the Centos ISOs. This will be Security, BugFix, or Enhancements to the [Base] software. It is enabled by default.
  5. Addons Repository:
  6. [Addons] - Contains packages required in order to build the main Distribution or packages produced by SRPMS built in the main Distribution, but not included in the main Red Hat package tree (mysql-server in Centos-3.x falls into this category). Packages contained in the addons repository should be considered essentially a part of the core distribution, but may not be in the upstream Package tree. It is enabled by default.
  7. Contrib Repository:
  8. [Contrib] - Packages contributed by the Centos Users, which do not overlap with any of the core Distribution packages. These packages have not been tested by the Centos developers, and may not track upstream version releases very closely. It is disabled by default.
  9. Centosplus Repository:
  10. [Centosplus] - Packages contributed by Centos developers and the users. These packages might replace rpm's included in the core distribution. You should understand the implications of enabling and using packages from this repository. It is disabled by default.
  11. CSGFS:
  12. [csgfs] - Packages that make up the Cluster Suite and Global File System. It is disabled by default.
  13. Extras:
  14. [Extras] - Packages built and maintained by the Centos developers that add functionality to the core distribution. These packages have undergone some basic testing, should track upstream release versions fairly closely and will never replace any core distribution package. It is enabled by default.
  15. Testing:
  16. [Testing] - Packages that are being tested proir to release, you should not use this repository except for a specific reason. It is disabled by default. You can obtain it by performing this command: cd /etc/yum.repos.d/ && wget http://dev.centos.org/centos/5/CentOS-Testing.repo
    
    subsequently, you can use it by doing the following: yum --enablerepo=c5-testing search */php (note: we recommend you DO NOT leave this repo enabled and only use it as described above.)

Section 2

3rd Party Software Repositories

These are known safe repositories when used alone with default Centos repositories. They are safe to leave enabled and known to integrate well with Centos. Do not mix them together or with other repos or you will have conflicts eventually, pick one or the other.

  1. EPEL: Extra Packages for Enterprise Linux (EPEL) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs such as Centos or Scientific Linux. Find out more information here: EPEL Homepage
  2. EL4: rpm -ivh http://download.fedora.redhat.com/pub/epel/4/i386/epel-release-4-9.noarch.rpm
    EL5: rpm -ivh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
    
    After this install successfully completes, run this command as root:
    sed -i 's/^enabled=1/enabled=0/' /etc/yum.repos.d/epel.repo
  3. RPMForge: RPMforge is one of the participating repositories in the rpmrepo project. Find out more here: https://rpmrepo.org/RPMforge make sure to use the yum-priorities plugin with this repository (as root: yum install yum-priorities).
  4. EL5/i386: rpm -ivh http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
    EL5/x86_64: rpm -ivh http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
    
    EL4/i386: rpm -ivh http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
    EL4/x86_64: rpm -ivh http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.x86_64.rpm
    
    After this install successfully completes, run this command as root:
    sed -i 's/^enabled=1/enabled=0/' /etc/yum.repos.d/rpmforge.repo
  5. RPMFusion: RPMFusion is a repository of add-on packages for Fedora and RHEL+EPEL maintained by a group of volunteers. RPMFusion is not a standalone repository, but an extension of RHEL/Centos/Fedora. RPMFusion distributes packages that have been deemed unacceptable to Red Hat or Fedora. See configuration options at RPMFusion.org
  6. Freeworld: Free software repository config can be downloaded here: free.repo
    non-Freeworld: non-Free software repository config can be downloaded here: non-free.repo
    
    After this install successfully completes, run these 2 commands as root:
    sed -i 's/^enabled=1/enabled=0/' /etc/yum.repos.d/rpmfusion-free-updates.repo
    sed -i 's/^enabled=1/enabled=0/' /etc/yum.repos.d/rpmfusion-nonfree-updates.repo
  7. The above sed command puts these repos in a default disabled state to keep you or another person with software installation access from making a mistake that could destroy the system. To search for software in these repositories or install software you would use commands similar to these:
  8. To search:
    yum --enablerepo=epel search denyhosts
    yum --enablerepo=rpmforge search fail2ban
    yum --enablerepo=epel --enablerepo=rpmforge search */php
    
    To install:
    yum --enablerepo=epel install denyhosts
    yum --enablerepo=rpmforge install fail2ban
    
    Things NOT to do:
    yum --enablerepo=epel --enablerepo=rpmforge update
    
    The reason these repositories cannot be enabled together in any sane fashion is due to methodology.
    Each repository has its own way of packaging and integrating the packages into the system. They can
    be used together with some common sense and planning, but you need to understand and take appropriate
    precautions.
    
    Use of the yum-priorities plugin is highly encouraged to further prevent unwanted overwriting of key
    files or rpms on the system. This plugin is configured via:
    /etc/yum.conf
    /etc/yum/pluginconf.d/priorities.conf
    /etc/yum.repos.d/*.repo files
    
    Configuration:
    /etc/yum.conf
    make sure this line is included:
    plugins=1
    
    /etc/yum/pluginconf.d/priorities.conf
    make sure these lines are included:
    [main]
    enabled=1
    check_obsoletes=1
    
    /etc/yum.repos.d/*.repo
    make sure this line is added to all *.repo files:
    priority=N (where N is an integer between 1-99)
    
    This setting is the most important of the 3. The first 2 make sure the plugin is enabled, the last tells yum what repositories have priority over the others. 1 =- most priority, 99 == least. You'll want to make sure the default Centos repos are set to 1 and the others according to your personal preferences.
    
    Please see: http://wiki.centos.org/PackageManagement/Yum/Priorities for verbose explanations.
    

Check out the Centos wiki for more in-depth information

More Information

Any additional information or notes.

Disclaimer

We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #centoshelp on irc.freenode.net

Added Reading


© 2012 CentosHelp.org