feisky

云计算、虚拟化与Linux技术笔记
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

获取Centos命令对应的源码

Posted on 2012-02-06 21:40  feisky  阅读(958)  评论(0编辑  收藏  举报

 

安装工具

# yum install yum-utils

 

设置源:

[base-src]

name=CentOS-5.4 - Base src -

baseurl=http://vault.centos.org/5.4/os/SRPMS/

#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=SRPMS&repo=os

gpgcheck=1

gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

 

[updates-src]

name=CentOS-5.4 - Updates src-centos

baseurl=http://vault.centos.org/5.4/updates/SRPMS/

#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=SRPMS&repo=updates

gpgcheck=1

gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

 

#packages used/produced in the build but not released

[addons-src]

name=CentOS-5.4 - Addons src -

baseurl=http://vault.centos.org/5.4/addons/SRPMS/

#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=SRPMS&repo=addons

gpgcheck=1

gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

 

#additional packages that may be useful

[extras-src]

name=CentOS-5.4 - Extras src-centos

baseurl=http://vault.centos.org/5.4/extras/SRPMS/

#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=SRPMS&repo=extras

gpgcheck=1

gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

 

#additional packages that extend functionality of existing packages

[centosplus-src]

name=CentOS-5.4 - Plus src-centos

baseurl=http://vault.centos.org/5.4/centosplus/SRPMS/

#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=SRPMS&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

 

#contrib - packages by Centos Users

[contrib-src]

name=CentOS-5.4 - Contrib src-centos

baseurl=http://vault.centos.org/5.4/contrib/SRPMS/

#mirrorlist=http://mirrorlist.centos.org/?release=5.4&arch=SRPMS&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-5

 

下载命令对应的源码:

# rpm -qf `which mkdir`

coreutils-5.97-23.el5

# yumdownloader --source coreutils

# rpm2cpio coreutils-5.97-23.el5_4.2.src.rpm | cpio -id

这样就得到了源码包coreutils-5.97.tar.bz2

无觅相关文章插件,快速提升流量