Linux packages
To add the necessary modules to the Linux kernel, the setup program needs the following Linux packages:
The package with kernel headers or sources. The package version must match the kernel version.
The GNU Compiler Collection (GCC) compiler system. The GCC version must be the one with which the kernel was compiled.
The Make tool.
The Perl interpreter.
The
libelf-dev
,libelf-devel
, orelfutils-libelf-devel
libraries for building kernels starting with 4.15 and configured with CONFIG_UNWINDER_ORC=y. For some distributions, such as Fedora 28, they need to be installed separately from kernel headers.
The names of these packages vary depending on your Linux distribution.
In Red Hat Enterprise Linux, CentOS, and Fedora, the packages normally will be installed by the setup program. In other distributions, you need to install the packages if they are not installed or do not have the required versions.
Are the required packages already installed?
To check whether the packages are already installed, perform these steps:
Run the following command to find out the kernel version and the required GCC version:
This command returns lines similar to the following:
Linux version 2.6.35.6
andgcc version 4.5.1
Run the following command to check whether the Make tool and the GCC compiler are installed:
For gcc, ensure that the version returned by the command is the same as in the
gcc version
in step 1. For make, just ensure that the command runs.Check whether the appropriate version of the packages for building kernel modules is installed:
In Red Hat Enterprise Linux, CentOS, and Fedora, run the following command:
In Ubuntu, run the following commands:
In either case, ensure that the package versions are the same as in
Linux version
in step 1.Run the following command to check whether the Perl interpreter is installed:
If you see the information about the Perl version, the interpreter is installed.
In Red Hat Enterprise Linux, CentOS, and Fedora, run the following command to check whether
elfutils-libelf-devel
is installed:If you see the information about the library version, the library is installed.
Installing the packages from the repository
The following table lists how to install the required packages in various Linux distributions.
Linux distribution | Package names | How to install |
---|---|---|
Red Hat Enterprise Linux | kernel-devel gcc make elfutils-libelf-devel | The setup program will download and install the packages automatically by using your Red Hat subscription. |
perl | Run the following command: | |
CentOS Fedora | kernel-devel gcc make elfutils-libelf-devel | The setup program will download and install the packages automatically. |
perl | Run the following command: | |
Ubuntu Debian | linux-headers linux-image gcc make perl | Run the following commands: |
SUSE Linux OpenSUSE | kernel-source gcc make perl |
The packages will be downloaded from the distribution's repository and installed.
For other Linux distributions, please refer to the distribution's documentation regarding the exact names of the required packages and the ways to install them.
Installing the packages manually
You may need to install the packages manually if:
The machine does not have an active Red Hat subscription or Internet connection.
The setup program cannot find the kernel-devel or gcc version corresponding to the kernel version. If the available kernel-devel is more recent than your kernel, you need to either update the kernel or install the matching kernel-devel version manually.
You have the required packages on the local network and do not want to spend time for automatic search and downloading.
Obtain the packages from your local network or a trusted third-party website, and install them as follows:
In Red Hat Enterprise Linux, CentOS, or Fedora, run the following command as the root user:
In Ubuntu, run the following command:
Example: Installing the packages manually in Fedora 14
Follow these steps to install the required packages in Fedora 14 on a 32-bit machine:
Run the following command to determine the kernel version and the required GCC version:
The output of this command includes the following:
Obtain the kernel-devel and gcc packages that correspond to this kernel version:
Obtain the make package for Fedora 14:
Install the packages by running the following commands as the root user:
You can specify all these packages in a single
rpm
command. Installing any of these packages may require installing additional packages to resolve dependencies.
Last updated