My current kernel is 3.2.0-26 (my main computer) while on another of my Ubuntu computers, with which I didn't fiddle with unofficial updates, it's 3.2.0-30. Yet the Update manager on my main computer doesn't show available kernel updates. It shows other updates though.

I suspect is due to the fact that in the past I installed multiple mainline kernel versions (not recommended versions), up to 3.5* series.

What I'm after: Either: Fix automatic kernel updates. Or: Learn about a way to check for the latest official ubuntu kernel version and get it manually (I know how to install kernels from debs)

What I have already tried: Uninstalled unused kernels including "the generic one without a number" as per https://askubuntu.com/a/103875/29347 and then also https://ubuntugenius.wordpress.com/2011/01/08/ubuntu-cleanup-how-to-remove-all-unused-linux-kernel-headers-images-and-modules/

Your problem with automatic updates may be because of the mainline kernels or because you removed the "generic" package.

You can update to the latest kernel via apt-get as follows:

sudo apt-get update
sudo apt-get install linux-image-`uname -r`

If you also need the headers (to compile kernel modules such as wireless drivers):

sudo apt-get install linux-headers-`uname -r`
  • 7
    The return I get is 'linux-image-3.2.0-26-generic is already the newest version.' while in fact it's not (please see the original question). Are you sure you gave me the right terminal commands? I'm not an expert in the matter but to me the commands translate to "update kernel to the same version you already have installed and use". – Bucic Sep 14 '12 at 16:48
  • 5
    Could you please explain what this is supposed to do? linux-image-`uname -r` just tries to reinstall the kernel you already have, so how is that useful in any way? – Asad Saeeduddin May 29 '15 at 4:10

In case you only want to update the default kernel you should be able to fix it with:

sudo apt-get install linux-image-generic

Since linux-image-generic always depends on the newest default kernel of your distribution, the kernel gets upgraded with the rest of the packages when you run apt-get upgrade.

When you want to update a non default kernel you can do this by running this script:

#!/usr/bin/env bash

sudo apt-get update
kernel_release="$(uname -r | cut --complement -d'.' -f3)"
kernel_release_versions="$(apt-cache search linux-image-${kernel_release})"
kernel_release_versions_generic="$(grep linux-image-"${kernel_release_version}".*-generic <<< "$kernel_release_versions")"
newest_kernel_of_release="$(echo "$kernel_release_versions_generic" | tail -n1 | cut -d' ' -f1 )"

sudo apt-get install $newest_kernel_of_release

sudo apt-get dist-upgrade

If you also need the header files, additionally run the following:

newest_kernel_of_release_headers=${newest_kernel_of_release/image/headers}

sudo apt-get install $newest_kernel_of_release_headers
  • 1
    I think OP is looking for latest mainline / stable kernel – WinEunuuchs2Unix Jan 8 at 18:14

"You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this:

deb http://security.ubuntu.com/ubuntu raring-security main

"

via

http://packages.ubuntu.com/raring/all/linux-headers-3.8.0-31/download

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.