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. ios开发之 -- stringByAddingPercentEscapesUsingEncoding方法被替换 iOS9.0

    最近在项目中,发现之前的一个方法已经不被建议使用了. 该方法名即题目中提到的: stringByAddingPercentEscapesUsingEncoding,这个方法是用来进行转码的,即将汉字转 ...

  2. iOS 使用动态库

    苹果的开放态度 WWDC2014上发布的Xcode6 beta版有了不少更新,其中令我惊讶的一个是苹果在iOS上开放了动态库,在Xcode6 Beta版的更新文档中是这样描述的: Frameworks ...

  3. 基于端口的弱口令检测工具--iscan

    亲手打造了一款弱口令检测工具,用Python编写,主要可以用于内网渗透.弱口令检测等方面,目前集成了常见端口服务,包含 系统弱口令:ftp.ssh.telnet.ipc$ 数据库弱口令:mssql.m ...

  4. 使用dshow捕获摄像头图像

    #include "stdafx.h" #include <DShow.h> #include <Guiddef.h> #include <strmi ...

  5. Selenium 异常处理

    在使用 Selenium 的过程中,难免会遇到一些异常,例如超时.节点未找到等错误,我们可以使用 try...except... 语句来捕获各种异常 更多异常类参考官网:https://seleniu ...

  6. C语言的f(open)函数(文件操作/读写)

    头文件:#include <stdio.h> fopen()是一个常用的函数,用来以指定的方式打开文件,其原型为:     FILE * fopen(const char * path, ...

  7. 【delphi】delphi出现‘尚未调用CoInitialize’异常

    1. 由于使用ado等引起的异常. 2. 若是子线程或某方法操作ado可在该方法开头和结尾分别加上: function myfun begin CoInitialize(nil); // your c ...

  8. SQL - 只获取小时

    --时间小时加减 SELECT DATEADD(HOUR, -8, GETDATE()) FROM [Order] --使用convert转换时间格式获取小时,并转成int类型 SELECT CONV ...

  9. EGit系列第二篇——关联远程仓库

    网上也有很多代码托管网站支持git,像最出名的GitHub,还有国内支持私有项目的OSC开源中国和CSDN等... 首先得注册个帐号,然后才可以创建仓库 一般都会带一个ReadMe.md,你可以勾选也 ...

  10. WP8.1学习系列(第一章)——添加应用栏

    做过android开发的同学们应该都知道有个ActionBar的头部操作栏,而wp也有类似的一个固定在app页面里通常拥有的内部属性,就是应用栏.以前叫做ApplicationBar,现在wp和win ...