22

I am running an instance of Ubuntu 15.10. I need to install the latest kernel used by Ubuntu 14.10, which I think is 3.16.0-28-generic. Entering sudo apt-get install linux-image-3.16.0-28-generic returns an error message stating that it's not available and may have been obsoleted or whatever. I think if I add something to sources.list it will be able to get it. But what do I add to it?

And before anyone goes on about the troubles this may produce, it doesn't matter to me.

4 Answers 4

29

In Ubuntu, use browser to navigate to > http://kernel.ubuntu.com/~kernel-ppa/mainline/ Scroll to the bottom of the list; choose your kernel. Download the following files (xxxxxx will be replaced with numbers indicating the kernel version. Assuming you have a 64bit OS):

linux-headers-xxxxxx-generic-xxxxxx_amd64.deb

linux-headers-xxxxxx_all.deb

linux-image-xxxxxx-generic-xxxxxx_amd64.deb

Move all these files to a folder. cd into it. Install all these packages by running

sudo dpkg -i *.deb

Choose new kernel from grub menu.

Update: Since its an ubuntu instance you can manually get the links and and use wget to download the packages

5
  • 1
    What is meant by choose new kernel from grub menu? Jan 19, 2018 at 14:13
  • I wrote this answer thinking of a ubuntu desktop, in which u will get each entry for each kernel, for a server instance, u can just restart the server then it will boot automatically to latest kernel.. Or u can edit the config for a specific kernel
    – Sijin T V
    Jan 19, 2018 at 14:56
  • @Sijin Krishnan Should we manually edit grub menu before reboot to "choose new kernel from grub menu"?
    – WebComer
    Nov 28, 2018 at 16:24
  • The grub will boot with the latest version of kernel from the installed ones by default.. you only need to touch the config, if you want to boot with any other lower version s...
    – Sijin T V
    Nov 28, 2018 at 16:33
  • You will also need to download linux-modules-version_amd64.deb and the order of installation requires that the modules be installed before the kernel image. Tony George manages a private ppa which releases a Ubuntu Kernel Update Utility (ukuu) which looks promising though I was unable to install it on 18.04.2 today. It seems to have been released for other Ubuntu versions and I may attempt to fix the packaging for 18.04.2 on launchpad. Jun 21, 2020 at 7:32
8

If you know the exact version you want, e.g. 5.4.0-26-generic, just run

sudo apt install linux-image-5.4.0-26-generic

The dependencies will be installed automatically. Then in the next boot, select it in the grub menu.

1
  • For me this installed (in my case) the linux-modules-5.19.0-32-generic package too but I 'felt' something in missing (as i usually remove 3 packages when 'uninstalling' a kernel). System booted indeed but Xorg/gnome was not running, just tty. I also needed to run sudo apt install linux-modules-extra--yourversion-generic for gnome to work.
    – nuala
    Apr 25, 2023 at 18:22
3

If you want the official Ubuntu stock kernel (not a mainline kernel) from an unsupported version, see below.

For differences between Mainline and Stock kernels see https://askubuntu.com/a/91374/555474

I had to install an even older kernel (2.6.32.21-generic) for stock modules to work with a custom kernel. No hardware was working, so I had to download manually.

Here is how to obtain the discontinued kernels manually from http://old-releases.ubuntu.com/ubuntu/

Essentially you will need the kernel's headers for your processor, common (all) headers, and the kernel image for your processor.

  1. In the steps below, replace x.x.xx-xx with your kernel version and amd64 with your processor type. Note this is for the generic kernel and not using extra features such as PAE.

  2. Go to http://old-releases.ubuntu.com/ubuntu/pool/main/l/linux/ (I believe this lists most if not all the old kernel packages)

  3. In the page CTRL+F find headers-x.x.xx-xx-generic and download the
    1. linux-headers-x.x.xx-xx-generic_x.x.xx-xx.yy_amd64.deb
    2. linux-headers-x.x.xx-xx-generic_x.x.xx-xx.yy_all.deb
  4. In the page CTRL+F find image-x.x.xx-xx-generic and download the

    1. linux-image-2.6.32-21-generic_2.6.32-21.32_amd64.deb
  5. Put all of these packages in a folder alone, and from that folder (cd into it) run

    1. sudo dpkg -i *.deb
2

The easiest way is to install Ubuntu Mainline Kernel Installer.
In terminal type the following commands:

sudo add-apt-repository ppa:cappelikan/ppa
sudo apt update
sudo apt install mainline

see screenshot:
enter image description here.
It is Gui-based and very easy to use to add and remove mainline (hence the name) kernels.

4
  • If I type mainline at the command line, no GUI appears. Oct 17, 2022 at 8:22
  • @david.perez try searching in activities bar, you will find it.
    – Raj
    Oct 26, 2022 at 5:44
  • @david.perez, did you install the program? Then you can open it through the application launcher. Oct 27, 2022 at 7:05
  • 1
    it is a console app with no GUI, and I can only select very recent kernels. It is usable. Oct 28, 2022 at 6:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .