我该如何添加/启用包含 CentOS 5 中所有源文件包的存储库?以及添加/启用哪个存储库?
这是为了使yumdownloader --source <package_name>
答案1
事实证明,源 repo 定义未包含在内。添加以下内容/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
答案2
将 Ignacio 的答案标记为正确,但在我看到答案之前我最终使用了以下内容:
[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