The Linux kernel source download method for CentOS

Source: Internet
Author: User
Tags rpmbuild

Just start to write Linux drive, write good Makefile after make, appear scripts/xxx/makefile: No that file or directory, compile stop! Error, which is caused by Linux system not installing kernel source code.

For example



The following is the introduction of the download Kernel source code method


1. View your CentOS version

Directive Cat/etc/issue


2. View your Linux kernel version

Instruction Uname-r or uname-a


3. Go to the official website to download

By the above two steps we know ourselves the CentOS version is 6.7 and the kernel version is 2.6.32-573.el6.i686

Source code of the official website: http://vault.centos.org/

Enter the official website, once again into the 6.7/, into the os/, into the source/, into the spackages/, find kernel-2.6.32-573.el6.src.rpm download on the line

can also be downloaded directly from the Linux system, for example

It's OK.


Supplemental installation

Install kernel source code


The directory/root/rpmbuild/specs and/root/rpmbuild/sources are generated.

Use the Find-name directoryname-type d command to find these two files.

Go to specs to install the source package

Install the missing packages on each of the above prompts with the Yum install command.


The Linux kernel source download method for CentOS

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.