How to Install Kernel Headers in Ubuntu [Quick Tips]

Sometimes, when you are compiling an application or packages in your Terminal, you will encounter an error saying “missing kernel header”. This is usually the case when you have just upgraded your kernel and the kernel headers information for the latest kernel is not downloaded to your system. When this happens, you usually won’t be able to compile your packages.

i always have this issue after upgrading to the latest kernel and Virtualbox will always fail everytime I open it. The solution will be to recompile the Vbox kernel module which then lead to the missing kernel header error.

The fix for this is simple. You just have to install (or re-install if you have done so previously) the kernel header for your latest kernel.

1. Open a terminal and type:

This should fetch and install the kernel headers for your latest kernel. That’s it. You should be able to compile your packages without problem now.

Damien Damien

Damien Oh started writing tech articles since 2007 and has over 10 years of experience in the tech industry. He is proficient in Windows, Linux, Mac, Android and iOS, and worked as a part time WordPress Developer. He is currently the owner and Editor-in-Chief of Make Tech Easier.