In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "how to install Linux kernel header files on Linux systems". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install Linux kernel header files on Linux systems.
When you are compiling a device driver module, you need to install kernel header files in the system. Kernel headers are also needed when you compile user-space programs that are directly linked to the kernel. When you install kernel header files in these cases, you must ensure that the kernel header files accurately match your current kernel version (for example: 3.13.0-24-generic).
If your kernel is the version of the kernel that comes with the distribution, or if you upgrade it using the default package manager's base repository (such as apt-ger, aptitude, or yum), you can also use the package manager to install kernel headers. On the other hand, if you downloaded the kernel source code and compiled it manually, you can use the make command to install the matching kernel header files.
Now that we assume that your kernel is shipped with the distribution, let's take a look at how to install matching header files.
Install kernel header files on Debian, Ubuntu, or Linux Mint
Assuming you don't compile the kernel manually, you can use the apt-get command to install matching kernel headers.
First, use the dpkg-query command to check if a kernel header file is available.
The code is as follows:
$dpkg-query-s linux-headers-$ (uname-r)
Dpkg-query: package 'linux-headers-3.11.0-26 Murray generic` is not installed and no information is available
Then use the following command to install the matching kernel header file.
The code is as follows:
$sudo apt-get install linux-headers-$ (uname-r)
Verify that the header file is installed successfully.
The code is as follows:
$dpkg-query-s linux-headers-$ (uname-r)
Package: linux-headers-3.11.0-26-generic
Status: install ok installed
The default header files for Debian, Ubuntu and Linux Mint are under / usr/src.
Install kernel header files on Fedora, CentOS, or RHEL
Assuming you don't compile the kernel manually, you can use the yum command to install matching kernel headers.
First, check to see if the header file is installed on the system with the following command. If the following command does not have any output, it means that there is no header file.
The code is as follows:
$rpm-qa | grep kernel-headers-$ (uname-r)
Then use the yum command to install the header file. This command automatically finds the appropriate header file and installs it.
The code is as follows:
$sudo yum install kernel-headers
Verify the status of the package installation.
The code is as follows:
$rpm-qa | grep kernel-headers-$ (uname-r)
Kernel-headers-3.10.0-123.9.3.el7.x86_64
At this point, I believe you have a deeper understanding of "how to install Linux kernel header files on Linux systems". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.