Q. When I try to compile and install a driver downloaded from other website I get the error message:
You need to have the linux kernel source installed for this driver

How do I fix this problem and how do I install Linux kernel source code?

A. You need to install kernel source code and most important kernel headers in order to compile a driver or module.

The kernel headers are necessary if you require to install a driver for Nvidia, ndiswrapper, Cisco VPN, Vmware, Wireless card and many other drivers. If a driver requires kernel sources, it may be sufficient to install only the kernel headers.

Find running kernel version

First find out running kernel version, by typing:
$ uname -r
Output:

2.6.20-15-generic

Task: Install Kernel source and headers for Redhat Enterprise Linux or CentOS Linux

Use command to install both kernel source code and headers, enter:
# up2date kernel-source kernel-devel
If you are using RHEL/CentOS 5 or Fedora core, try:
# yum install kernel-source kernel-devel

Task: Download Kernel source code for running kernel

You can visit official Linux kernel website and install source code


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum