Skip to end of metadata
Go to start of metadata

Symptom


It is common place for system administrators to not want to reboot their machine and rightfully so. You might find yourself in a situation where you don’t’ have the latest version of the kernel and yum isn’t giving you the kernel-devel package that you need to build the r1soft hcpdriver.

Cause


The system has an older kernel but you are not ready to upgrade it, but the kernel-devel package for your running kernel is not available in the standard CentOS repository.

Resolution


You may have a kernel that is no longer in the repository. If this is the case you can find all of the older packages at http://vault.centos.org. The first step is to ascertain what version of Centos you are running, to do so please see the command below.

[root@centos~]# cat /etc/redhat-release CentOS release 5.6 (Final)

In this example the version is CentOS 5.6. By default your installation should include an entry for the vault repository located at /etc/yum.repos.d/CentOS-Vault.repo

The file for the repository has 4 entries for each of the previous versions one for the base, updates, centosplus, and extras. For the sake of brevity in our example we just include the entries for 5.6 in our example. The goal is to enable each of these so that yum can install the packages you need for your version. To do so we will find the enable line and change the value from 0 to 1.

enabled=0

enabled=1

To make the changes open up your favorite editor and make the change the enable line for the base, and updates entries in the repository.  Once you have completed this it will look like the example below.

[root@centos~]# nano /etc/yum.repos.d/CentOS-Vault.repo

[C5.6-base] name=CentOS-5.6 - Base baseurl=http://vault.centos.org/5.6/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 enabled=1 [C5.6-updates] name=CentOS-5.6 - Updates baseurl=http://vault.centos.org/5.6/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 enabled=1

 
In some cases an entry for your version may not exist in the CentOS-Vault.repo file, however you can edit the file to add the entries you need. The process involves adding new entries in the repo file including your version number from the template below.

[C(Your Version Number)-base] name=CentOS-(Your Version Number) - Base baseurl=http://vault.centos.org/(Your Version Number)/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 enabled=1 [C(Your Version Number-updates] name=CentOS-(Your Version Number) - Updates baseurl=http://vault.centos.org/(Your Version Number)/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 enabled=1

Once you have made the changes to the CentOS-Vault.repo you can try installing your kernel headers with shell expansion.

[root@centos~]# yum install kernel-devel-$(uname -r) -y

If you are you are running a PAE or Xen kernel there are separate devel packages for these kernels named kernel-PAE-devel kernel-xen-devel. Some example commands are listed below.

For Xen:

[root@centos ~]# UNAME=$(awk '{gsub(/xen/,"",$3);print $3}' /proc/version) [root@centos ~]# yum install kernel-xen-devel-${UNAME} -y

For PAE:

[root@centos ~]# UNAME=$(awk '{gsub(/PAE/,"",$3);print $3}' /proc/version) [root@centos ~]# yum install kernel-PAE-devel-${UNAME} -y

This is also typically a non issue for Debian and Ubuntu users as the kernel headers are included in the base install.

Related Articles


Page: Linux Agent - Error - Replication Driver Missing (Knowledge Base) Labels: replication, driver, kernel, kernel-devel, kernel-xen-devel, kernel-pae-devel, header
Page: Building a replication driver for openSUSE (Knowledge Base) Labels: kernel, kernel-devel, dirver, header, replication, driver, kernel-pae-devel, kernel-xen-devel
Page: Finding Old kernel-devel Packages For CentOS (Knowledge Base) Labels: kernel
Page: Installing Virtuozzo Kernel Headers (Knowledge Base) Labels: kernel
Labels:
kernel kernel Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.