Admin Spotting for Fun and Profit

Getting the Source

February 17th, 2008 Posted in Linux

There seem to be more and more people wanting to get their hands on the CentOS source rpms for various reasons. Some are looking to see the secret options used in the CentOS brew. Others are looking to make modifications, and some are looking simply to learn.

A while back, the CentOS folks added source repository support to the mirrors, but there was never an addition to the mirrorlist tool to add SRPM as a valid repository option. There was also no addition to /etc/yum.repos.d with the source repository descriptions. This has led to various chatter on irc for people asking how to get to the source repositories.

To get access to the CentOS source repositories, you will need 2 things. The yum-utils plugin, which is available in the extras repository, and the CentOS-Source.repo file. This file contains the source repository definitions for the CentOS 5 Base, Updates, Extras, and CentOSPlus reposositories.

Simply drop this file into /etc/yum.repos.d/ and use yumdownloader to fetch your source rpm. A sample command is listed below:

yumdownloader --source -e c5-updates-src mysql

Post a Comment