zoukankan      html  css  js  c++  java
  • centos source install

    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/

     

     
  • 相关阅读:
    python 快速排序详述
    GitHub 小试牛刀(踩坑记录)
    python 内部类
    Django1.11搭建一个简易上传显示图片的后台
    Ubuntu16.04卸载opencv2.4.9并安装opencv3.2.0+contrib
    OpenCV4Android背景建模(MOG、MOG2)
    CentOS7.3安装NVIDIA-1080ti驱动、cuda、cudnn、TensorFlow
    TensorFlow Object Detection API(Windows下测试)
    关于git常见的一些问题
    聊聊Java中的反射(一)
  • 原文地址:https://www.cnblogs.com/SZLLQ2000/p/5058966.html
Copyright © 2011-2022 走看看