Linux system operation, sometimes need to install the kernel header file when installing the device driver, and many friends do not know what is the kernel header file, naturally do not know how to install, the following small I will introduce you to the method of installing kernel header files in Linux.
Question: I need to install the kernel header file before installing a device driver. How to install the appropriate kernel header file?
When you are compiling a device driver module, you need to install the kernel header file on your system. Kernel header files are also needed when you compile userspace programs that are directly linked to the kernel. When you install kernel headers in these situations, you must ensure that the kernel headers match exactly your current kernel version (eg 3.13.0-24-generic).
If your kernel is release comes with the kernel version, or use the default base warehouse package manager to upgrade (for example: apt-ger, aptitude or yum), you can also use The package manager installs the kernel header files. On the other hand, if you downloaded the kernel source and compiled it manually, you can use the make command to install the matching kernel headers.
Now let's assume that your kernel is included with the distribution. Let's see how to install matching header files.
Installing Kernel Header Files on Debian, Ubuntu, or Linux Mint
Assuming you didn't compile the kernel manually, you can use the apt-get command to install matching kernel header files.
First, use the dpkg-query command to check if there are kernel header files available.
$ dpkg-query -s linux-headers-$(uname -r)
dpkg-query: package ‘linux-headers-3.11.0-26-generic’ is not installed And no information is available
Then use the following command to install the matching kernel header file.
$ sudo apt-get install linux-headers - $ (uname -r)
Authentication Header files are successfully installed.
$ dpkg-query -s linux-headers-$(uname -r)
Package: linux-headers-3.11.0-26-generic
Status: install Ok installed
Debian, Ubuntu, Linux Mint default header files are under /usr/src.
Installing Kernel Header Files on Fedora, CentOS, or RHEL
Assuming you didn't manually compile the kernel, you can use the yum command to install matching kernel header files.
First, use the following command to check if the system has installed the header file. If the following command does not have any output, this means that there is no header file yet.
$ rpm -qa |
Grep kernel-headers-$(uname -r)
Then use the yum command to install the header files. This command will automatically find the appropriate header file and install it.
$ sudo yum install kernel-headers
verify the status of the installation package.
$ rpm -qa |
Grep kernel-headers-$(uname -r)
kernel-headers-3.10.0-123.9.3.el7.x86_64
Location of default kernel header files on Fedora, CentOS or RHEL Is /usr/include/linux.
The above is the introduction of the Linux kernel header file. It should be noted that the yum command can be used to automatically find the appropriate header file when installing the kernel header file to avoid unnecessary trouble.
Are you tired of the login interface of Ubuntu system, if you use your own image as the Ubuntu login
To understand the Linux system, it is necessary to have a certain understanding of its system archit
Fluentd as a log collection system, its users are still very large, but the steps t
For users, the constant update of Linux and Windows has caused competition between the two. Users ca
Ubuntu tips for installing Visual Studio Code
In the Linux system, the head command instance is explained in detail.
Linux how to use git to check out a separate branch
How to brush the original Debian system in the set-top box
Steps for Linux installation and configuration of GoLang development environment
Ubuntu how to modify the command prompt PS1
How to mount iPhone under Arch Linux system
Domestic system Linux Deepin 2014 detailed evaluation
Linux uses the sftp command to transfer files. Step
What should I do if I can't delete files in linux with root privileges?
AutoCAD tutorial: how to convert 3D solids into three views
Windows 8 super detailed graphic evaluation! Teach you to play Win8 (10)
Ubuntu comes with FTP server vsftpd tips
How to find the Control Panel in Windows8 system
Win10 system custom lock screen interface steps
How to uninstall IE8 browser in Win7 system? How to uninstall IE8 browser in
Win8.1 adds the SkyDrive folder to the user database for easy viewing.
IIS7 configuration maximum upload attachment size needs to pay attention to the steps and steps