Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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>

share|improve this question

2 Answers 2

up vote 7 down vote accepted

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
share|improve this answer
1  
FTR: bugs.centos.org/view.php?id=1646 –  mattdm Nov 16 '10 at 17:14
    
Unfortunately, source rpms seem to have disappeared from mirrors.centos.org and are now only on vault.centos.org . –  Xiong Chiamiov Dec 10 '13 at 23:24

Marked Ignacio's answer as correct, but I ended up using the following before I saw the answer:

[base-SRPMS]
name=CentOS-$releasever - Base SRPMS
baseurl=http://mirror.centos.org/centos/$releasever/os/SRPMS/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
enabled=1

#released updates
[update-SRPMS]
name=CentOS-$releasever - Updates SRPMS
baseurl=http://mirror.centos.org/centos/$releasever/updates/SRPMS/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
enabled=1
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.