CentOS Kernel Source Install

Mar 12th, 2012 | Comments

CentOS kernel source install, first off if you are just trying to build something or compile a tool on CentOS then you probably only need to install the kernel-devel package if you are running a standard install you can install the kernel-devel package on CentOS 6 with:

yum install kernel-devel

The above command will probably fix any compile issues you are having that ask for kernel source, if it does not please read on.

On CentOS 6 there is only one kernel-devel package for both architectures x86_64 and i386 however on CentOS 5 there are three versions, if you are unsure on what version you should install then run the command uname -r which will display your kernel version you then need to match the kernel version you are running with the correct kernel-devel package below:

CentOS 5 install kernel-devel for i386 & x86_64:

yum install kernel-devel

Centos 5 install Xen kernel-devel for x86_64 & i386:

yum install kernel-xen-devel

And finally to install kerenl-devel for PAE:

yum install kernel-pae-devel

CentOS Kernel source install (full) for CentOS 5 & 6

If install kernel-devel above does not work or you require the full CentOS kernel source for another reason you can install it on CentOS 5 & 6 with:

yum install rpm-build redhat-rpm-config unifdef

As a none root user run the following:

mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros

To install the CentOS 6 kernel source

The following command will install the kernel source for CentOS 6.2, you can install it for other version of CentOS 6 simply by using the URL for the alternative version.

rpm -i http://vault.centos.org/6.2/updates/Source/SPackages/kernel-2.6.32-220.7.1.el6.src.rpm 2>&1 | grep -v mockb

How To install the CentOS 5.8 kernel source

The following will install the full kernel source on CentOS 5.8, again the same applies – you can install the kernel source for another version of CentOS 5 by swapping the URL.

rpm -i http://vault.centos.org/5.8/updates/SRPMS/kernel-2.6.18-308.1.1.el5.src.rpm 2>&1 | grep -v mockb

When you have the correct kernel source RPM installed, run the following:

cd ~/rpmbuild/SPECS

And then unpack the kernel source with:

rpmbuild -bp --target=`uname -m` kernel-2.6.spec 2> prep-err.log | tee prep-out.log

Make sure you copy and paste the commands above as the uname -m command will pull your kernel arch (e.g x86_64) and prep the source for your kernel, you can find the kernel source in your home dir in a directory called rpmbuild/BUILD/ to access the CentOS kernel source install dir type the following as the logged in user you built the kernel source with ~/rpmbuild/BUILD/

 

 

centos source install的更多相关文章

  1. CentOS 7 install LNMP

    CentOS 7 install LNMP 关于 Nginx (发音 “engine x”)这是一款免费.开源.高效的 HTTP 服务器,Nginx是以稳定著称,丰富的功能,结构简单,低资源消耗.本教 ...

  2. Centos 7.5 通过yum安装GNOME Desktop时出现:file /boot/efi/EFI/centos from install of fwupdate-efi-12-5.el7.centos.x86_64 conflicts with file from package grub2-common-1:2.02-0.65.el7.centos.2.noarch

    系统版本为: [root@s10 ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) 由于管理kvm虚拟机的需求,需要安装 ...

  3. CentOS Kernel Source Install

    http://linuxmoz.com/centos-kernel-source-install/

  4. Centos yum install

    http://wiki.centos.org/TipsAndTricks/BrokenVserver centos mirror:  http://mirror.centos.org/centos/6 ...

  5. rhel6.4 using centos source

    rhel 默认的 yum 依赖于 rhn,要注册收费才能 update,改用 centos 的源: rpm -e yum* --nodeps rpm -qa | grep yum | xargs rp ...

  6. source install MacPorts--checking for Tcl configuration... configure: error: Can't find Tcl configuration definitions

    If you installed MacPorts using the package installer, skip this section. To install MacPorts from t ...

  7. CentOS 7 install Tensorflow-gpu

    # install TensorFlow GPU on CentOS 7.0# https://www.server-world.info/en/note?os=CentOS_7&p=tens ...

  8. centos yum install oracle java

    How to install Java on CentOS 7 | Linuxizehttps://linuxize.com/post/install-java-on-centos-7/ CentOS ...

  9. CentOS 7 Install Adobe Flash Player

    From Officail Adobe Flash Site don't down (YUM )adobe-release-x86_64-1.0-1.noarch.rpm,but to downloa ...

随机推荐

  1. Splash go() 方法

    go()方法用来请求某个链接,而且它可以模拟 GET 和 POST 请求,同时支持传入请求头.表单等数据 function main(splash) ok, reason = splash:go(&q ...

  2. 分布式计算开源框架Hadoop入门实践

    目录(?)[+] Author :岑文初 Email: wenchu.cenwc@alibaba-inc.com msn: cenwenchu_79@hotmail.com blog: http:// ...

  3. IOS 视频直播/智能家居(一行行敲代码,从零开始)lesson:1整体架构

    本文转载至 http://blog.csdn.net/u014011807/article/details/47144027 前段时间由于工作需要做了一个视频直播/智能家居类的应用.算是对iOS音视频 ...

  4. iOS中UIView翻转效果实现

    本文转载至  http://baishiyun.blog.163.com/blog/static/13057117920148228261747/ 新建一个view-based模板工程,在ViewCo ...

  5. 基础知识《零》---一张图读懂JDK,JRE,JVM的区别与联系

  6. python基础---->python的使用(三)

    今天是2017-05-03,这里记录一些python的基础使用方法.世上存在着不能流泪的悲哀,这种悲哀无法向人解释,即使解释人家也不会理解.它永远一成不变,如无风夜晚的雪花静静沉积在心底. Pytho ...

  7. 【python系列】python初识

    前言 Python是一种高层次,解释,互动性和面向对象的脚本语言,Python被设计成具有很强的可读性语言.它采用应用关键字,而其他语言一般使用标点符号,并且具有比其他语言有较少的语法结构. Pyth ...

  8. vuex - 常用命令学习及用法整理

    https://vuex.vuejs.org/zh-cn/api.html 命令 用途 备注 this.$store 组件中访问store实例 store.state.a 获取在state对象中的数据 ...

  9. VLC媒体视频播放器 v3.0.2官方版

    https://www.videolan.org/    VLC media player http://www.pc6.com/softview/SoftView_52483.html    VLC ...

  10. 注意@ Override不同版本的区别

    @Override注解用于方法的覆写上,它在编译期有效,也就是Java编译器在编译时会根据该注解检查是否真的是覆写,如果不是就报错,拒绝编译. 该注解很大程度解决我们的误写问题,比如子类和父类的方法名 ...