You Do Not Appear to Have the Sources for Kernel Installed

If you get the following error “You Do Not Appear to Have the Sources for Kernel Installed” (or similar) when trying to build Asterisk or DAHDI you have to install the kernel devel / kernel headers. This post covers kernel headers and kernel source installation for Debian, Ubuntu, Red Hat/Fedora/CentOS systems.
Asterisk Build Errors Related to Kernel Headers / Devel:

The CentOS, RHEL & Fedora:

To fix the above Asterisk kernel compile / build error on CentOS, RHEL & Fedora enter the following:

First update with YUM:

Install the kernel headers & kernel devel on CentOS / RHEL:

Reboot and attempt to rebuild Asterisk / DAHDI tools, if it still fails check your kernel version with:

And then check the linked kernel source:

Check the symbolic link with:

If the link is broken fix it with:

Ubuntu / Debian Install Kernel Source for Asterisk:

The following command will fix the asterisk kernel build error on Debian / Ubuntu based distributions.

Ubuntu install kernel source:

If you are running Debian or Ubuntu as root you can drop the sudo command, use:

Want me to do this for you? Drop me a line: itgalaxyzzz {at} gmail [dot] com