![将源代码仓库添加到 CentOS 5](https://linux22.com/image/530528/%E5%B0%86%E6%BA%90%E4%BB%A3%E7%A0%81%E4%BB%93%E5%BA%93%E6%B7%BB%E5%8A%A0%E5%88%B0%20CentOS%205.png)
我该如何添加/启用包含 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