Cannot install DAHDI Driver CentOS 6.6 (OS sources problem)

Hello everybody. I’ve been trying to install the DAHDI driver tar dahdi-linux-complete- on a CentOS 6.6 server. When I input the make command, I get the following error:

make -C linux all
make[1]: Entering directory /usr/src/dahdi-linux-complete-2.11.0+2.11.0/linux' make -C drivers/dahdi/firmware firmware-loaders make[2]: Entering directory/usr/src/dahdi-linux-complete-2.11.0+2.11.0/linux/drivers/dahdi/firmware’
make[2]: Leaving directory /usr/src/dahdi-linux-complete-2.11.0+2.11.0/linux/drivers/dahdi/firmware' [b]You do not appear to have the sources for the 2.6.32-504.el6.x86_64 kernel installed.[/b] make[1]: *** [modules] Error 1 make[1]: Leaving directory/usr/src/dahdi-linux-complete-2.11.0+2.11.0/linux’
make: *** [all] Error 2

I’ve already done a kernel update with the command yum install kernel-devel, but still got the same error.

Is the problem the version of DAHDI I’m trying with or the CentOS version instead?
Regards and thanks in advance

This can happen if you boot from a version that is different from the one for which you installed the -devel package.

A note from the Asterisk docs

Another dependency is required for installing DAHDI, and that is the kernel source. It is important that the kernel version being used match exactly that of the kernel source being installed. You can

use uname -a to verify the currently running kernel version:

CentOS: sudo yum install kernel-devel-`uname -r`

Ubuntu: sudo apt-get install linux-headers-`uname -r`

The use of uname -r surrounded by backticks (`) is for filling in the currently running kernel version so the appropriate package is installed.

Thanks for the fast reply. I’m a bit confused with this issue: if I input the command for installing the kernel-devel packages that match my OS version, I get the following error:

yum install kernel-devel-uname -r =>
No package kernel-devel-2.6.32-504.el6.x86_64 available.

If I check my version with uname -a, I get the following: 2.6.32-504.el6.x86_64

Why can’t I install my specific packages in order to install the DAHDI drivers? I’m really stuck with this
Thanks in advance …

A friend helped me finding the solution! Turns out that my CentOS didn’t refresh the symbolic link of the kernel. When navigating to /lib/modules/uname -r and inspecting with ls -l, the symbolic link build appeared as corrupt (red shaded) with the following route:

build -> …/…/…/usr/src/kernels/2.6.32-504.el6.x86_64

What I did was to change it to the proper version with the following commands:

rm build
ln -s /usr/src/kernels/2.6.32-573.12.1.el6.x86_64/ build

Dunno why this link wasn’t refreshed at first by the OS, but well I leave this solution for anyone facing the same problem.

Afterwards, I returned to my DAHDI folder and I could execute the make command succesfully