简体   繁体   中英

Kernel version not correct on ubuntu

I have this situation: Ubuntu 16.04;

When I called uname -a result is Linux pi 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux .

The problem is when I want to compile new drivers, the system gives me the error:

make[1]: *** /lib/modules/4.1.19-v7+/build: No such file or directory.  Stop.

But when I looked at /lib/modules/ , I find only version 4.4.38-v7+ . Maybe someone knows what it can be?

Thanks.

You need to have kernel-headers installed for the kernel version that you are trying to compile for.

sudo apt-get install linux-headers-$(uname -r)

You have kernel headers for 4.4.38-v7+, but not for your booted kernel of 4.1.19-v7+ (uname -r)

If you don't want to install 4.1.19-v7+ kernel-headers, reboot the system and boot into 4.4.38-v7+, and then try make, and it would compile the module for that particular kernel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM