ubuntu 14.04 uname reports wrong kernel version

August 27, 2015 3.3k views
Firewall Configuration Management Deployment Ubuntu

Hi I am running a digital ocean ubuntu 14.04 image. For some reason uname cmd reports 3.13.0-24 when the actual kernel should be 3.13.0-62.

bailey@bailey01 -> uname -mrs
Linux 3.13.0-24-generic x86_64

My system is up to date with the latest pkgs. The later kernel headers are available

bailey@bailey01 -> dpkg -l|grep linux-headers
ii  linux-headers-3.13.0-62             3.13.0-62.102                        all          Header files related to Linux kernel version 3.13.0
ii  linux-headers-3.13.0-62-generic     3.13.0-62.102                        amd64        Linux kernel headers for version 3.13.0 on 64 bit x86 SMP
ii  linux-headers-generic                              amd64        Generic Linux kernel headers

/boot/ has the correct files

bailey@bailey01 -> pwd;ls -l
total 29740
-rw-r--r-- 1 root root  1165261 Aug 12 04:15 abi-3.13.0-62-generic
-rw-r--r-- 1 root root   165763 Aug 12 04:15 config-3.13.0-62-generic
drwxr-xr-x 5 root root     4096 Aug 27 13:20 grub
-rw-r--r-- 1 root root 19351558 Aug 26 22:08 initrd.img-3.13.0-62-generic
-rw-r--r-- 1 root root   176500 Mar 13  2014 memtest86+.bin
-rw-r--r-- 1 root root   178176 Mar 13  2014 memtest86+.elf
-rw-r--r-- 1 root root   178680 Mar 13  2014 memtest86+_multiboot.bin
-rw------- 1 root root  3392306 Aug 12 04:15 System.map-3.13.0-62-generic
-rw------- 1 root root  5820896 Aug 12 04:15 vmlinuz-3.13.0-62-generic

I ran an update on the grub config using two different commands (grub-mkconfig and update-grub)

sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-62-generic
Found initrd image: /boot/initrd.img-3.13.0-62-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin

I rebooted the server after the mkconfig.

This started when I tried to configure iptables and received errors pointing to this erroneous kernel version

bailey@bailey01 -> sudo iptables -L
modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/3.13.0-24-generic/modules.dep.bin'
iptables v1.4.21: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

A google search has not returned any links that were helpful.

Help me Obi Wan Kenobi you are my last hope 8-)



4 Answers

Kernels do not upgrade automatically to a next major version (like 3.13 to 3.16) through routine updates. You can do it manually by running

sudo apt-get install linux-generic-lts-utopic

If you want to update the kernel to 3.19 use:

sudo apt-get install linux-generic-lts-vivid

You can read more about the HWE stack

After you are happy with the new kernel, you can remove 3.13.0-24 kernel meta-packages to prevent 3.13.0-24 kernels from updating. It can be done by

sudo apt-get remove linux-image-generic linux-headers-generic

Ran into that exact same problem on multiple occasions (at least on the Ubuntu kernels). It always surfaced with ipTables (and hence, CSF firewalls). For us, the short answer was a hard restart after the update process. Simply rebooting the droplet would not solve the issue.

(This assumes you've actually installed the updated kernel. We used a "manual" update process. An example can be be found all over StackExchange, including this fragment:)

Go here: http://kernel.ubuntu.com/~kernel-ppa/mainline/
Download 3 (maybe 4) debs to a folder somewhere:

linux-image-extra-VERSION-NUMBER_amd64.deb   # if available
Install the debs with whatever package manager front-end you use (is gdebi still around?), or use these commands:

cd /path/to/folder/where/you/put/the/debs
sudo dpkg -i *.deb

Note: this will "break" the ability to utilize the D/O droplet console to manage your kernel (under "settings --> kernel")

I had the same issue. I found the answer here:
How To Update a DigitalOcean Server's Kernel

by Adam LaGreca
Updating the kernel on your DigitalOcean Droplet is a straight forward process that differs slightly based on the Droplet's operating system. In this guide, we'll walk you through the process of updating your kernels for DigitalOcean Droplets.

@tmbailey123 did you ever get this solved? I have a similar issue on 15.04

gabriel@host:~$ uname -r

but it should be 3.19

Have another answer? Share your knowledge.