centos6.5 系统内核版本获取

最近需要修改内核的一部分功能,但是在linux源码网站https://www.kernel.org/上找不到具体的版本号,于是用直接wget,mark一下,又获得新技能了。
查看系统的讷内核版本:

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

然后再输入用wget获取redhat的rpm包

[root@localhost ~]# wget ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6ComputeNode/en/os/SRPMS/kernel-2.6.32-431.el6.src.rpm
--2015-04-19 23:51:10--  ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6ComputeNode/en/os/SRPMS/kernel-2.6.32-431.el6.src.rpm
           => “kernel-2.6.32-431.el6.src.rpm”
Resolving ftp.redhat.com... 209.132.183.61
Connecting to ftp.redhat.com|209.132.183.61|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD (1) /pub/redhat/linux/enterprise/6ComputeNode/en/os/SRPMS ... done.
==> SIZE kernel-2.6.32-431.el6.src.rpm ... 95465895
==> PASV ... done.    ==> RETR kernel-2.6.32-431.el6.src.rpm ... done.
Length: 95465895 (91M) (unauthoritative)

100%[======================================>] 95,465,895   357K/s   in 4m 9s   

2015-04-19 23:55:25 (375 KB/s) - “kernel-2.6.32-431.el6.src.rpm” saved [95465895]

查看下载的rpm包,并获取其中的linux内核源码文件

[root@localhost ~]# ls
anaconda-ks.cfg  Downloads           kernel-2.6.32-431.el6.src.rpm  Public     Videos
Desktop          install.log         Music                          rpmbuild
Documents        install.log.syslog  Pictures                       Templates
[root@localhost ~]# rpm -ivh kernel-2.6.32-431.el6.src.rpm 

执行完 rpm指令后,会创建文件夹其中包含内核tar包

[root@localhost rpmbuild]# cd ~/rpmbuild/SOURCES/
[root@localhost SOURCES]# ls
check-kabi                   config-powerpc64-rhel        genkey
config-debug                 config-powerpc-generic       kabitool
config-debug-rhel            config-powerpc-generic-rhel  kernel-abi-whitelists.tar.bz2
config-framepointer          config-s390x                 linux-2.6.32-431.el6.tar.bz2

这样就获得了系统中的内核源码文件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值