8

When I give in the terminal the command "sudo apt-get install linux-image" I see a list of kernels. How can I install such a kernel and what command should I give in the terminal to start a kernel??

JMS
  • 127
  • What is the Ubuntu version? – Pilot6 Oct 12 '15 at 22:12
  • 1
    By default Ubuntu will boot into the latest kernel, unless you specify otherwise during boot or in /etc/default/grub file. As for installing a kernel , there's two ways: with apt or manually download a kernel from kernel.org and install. I will post a more detailed answer later , because i am on mobile. Or others my do that : there are many more qualified users than me to explain this – Sergiy Kolodyazhnyy Oct 12 '15 at 22:21
  • 1
    The answer will be different for LTS and non-LTS versions. – Pilot6 Oct 12 '15 at 22:25
  • 1
  • 1
    Running sudo apt-get install linux-generic on a LTS "point" version will install an older kernel, etc. – Pilot6 Oct 12 '15 at 23:36
  • Could you please specify your reason for wanting to install a particular kernel instead of whatever kernel you already have. As it is, I'm not convinced it would be a good idea. – thomasrutter Jan 05 '18 at 00:53

4 Answers4

5

How can I install such a kernel?

If you supply the package version etc it should install that version

sudo apt-get install linux-image-3.13.0-24-generic

If for some reason you want to install loads of kernel, note that if you have a /boot partition, or a small root one you will likely run out of disk space, so the system won't boot.

Also, if you want to use a particular driver which only works with a certain kernel version, please make a question relevant to this

What command should I give in the terminal to start a kernel?

Kernels are the base part of system, so generally you need to reboot to change what is running at the core (probably not with linux kernel 4+ on some OSs with some updates though).

So change which kernel you are using you can reboot and show GRUB, then you can select to use the kernel - (The nearest command is sudo reboot which will reboot the system). By default it will choose the latest one (usually recomended for security stuff)

See also:

Wilf
  • 30,194
  • 17
  • 108
  • 164
0

Seems as this command works:

sudo apt install linux-image-5.19-0-21-generic=5.19.0-21.21

Should be "=" between name of package and version.

knst
  • 101
0

I use the following command in the terminal

sudo apt install linux-image-6.1.0-1008-oem linux-headers-6.1.0-1008-oem

That is for 6.1 kernel. For another kernel you have to modify the command consequently.

Mahler
  • 611
  • 8
  • 18
0

Install by selecting your choice from the list by using select/copy. Then past your choice (using the copy/paste method to get it spelled correctly) into the apt-get install command:

Example:

$ sudo apt-get install linux-image-3.19.0-30-generic 3.19.0-30.34

You can choose the kernel by clicking on Advinced Options for Ubuntu then move your arrow up or down for the kernel of your choice.

When you have a kernel that you are comfortable with you can edit your /boot/grub/grub.cfg (copying and pasting to ensure you have it spelled correctly) to use your preferred kernel.

L. D. James
  • 25,036