Adding the Source Repo to CentOS 5

How and what repository do I add/enable that contains all of the source file packages in CentOS 5?

This is in order to enable yumdownloader --source <package_name>


Solution 1:

It turns out that the source repo definitions are not included. Add the following as /etc/yum.repos.d/Centos-Source.repo:

[base-source]
name=CentOS-$releasever - Base Source
baseurl=http://mirror.centos.org/centos/$releasever/os/SRPMS/
enabled=0

[updates-source]
name=CentOS-$releasever - Updates Source
baseurl=http://mirror.centos.org/centos/$releasever/updates/SRPMS/
enabled=0

[addons-source]
name=CentOS-$releasever - Addons Source
baseurl=http://mirror.centos.org/centos/$releasever/addons/SRPMS/
enabled=0

[extras-source]
name=CentOS-$releasever - Extras Source
baseurl=http://mirror.centos.org/centos/$releasever/extras/SRPMS/
enabled=0

[centosplus-source]
name=CentOS-$releasever - Plus Source
baseurl=http://mirror.centos.org/centos/$releasever/centosplus/SRPMS/
enabled=0

[contrib-source]
name=CentOS-$releasever - Contrib Source
baseurl=http://mirror.centos.org/centos/$releasever/contrib/SRPMS/
enabled=0