0

I'm trying to install a linux-Kernel version 4.9.228 in my ubuntu 20.04. The kernel compiled successfully, without any errors. I also executed the command :

sudo make modules_install install

When I rebooted my system, To check whether it made correct entry ; I checked the files under /boot/ directory:

  • System.map-4.9.228
  • vmlinuz-4.9.228
  • initrd.img-4.9.228
  • config-4.9.228

I don't know why but when I ran uname -r. It hasn't updated my version. It still says 5.4.0-37-generic.

Please guide me if I am missing something.

  • 1
    Ubuntu 20.04 shipped with kernel version 5.4. Trying to install a kernel version below that is ill-advised. I think you might be experiencing an XY problem. What exactly is the problem you are facing that has convinced you that you need to install this specific kernel version? – Nmath Jun 20 '20 at 21:15
  • 1
    Kernels usually do not replace each other. You have to reboot, and select the one you want. Some version of Debian use 4.9, so you can try that instead. – mikewhatever Jun 20 '20 at 21:17
  • Disagree. Within reason, kernel are pretty much replaceable. For example, I am running kernel 4.5 from 2017.04.11 on an Ubuntu 20.04 server right now (but just for this example, not in general). However, you need to tell the system to load that kernel. – Doug Smythies Jun 20 '20 at 21:36
  • @Nmath Hi there, thanks for sharing your views. So, I was asked by a professor of mine to learn how to add system calls in a kernel. So, I found a tutorial that used linux-4.9.228. So, basically, I'm trying to learn how to add a system call and how to compile a kernel. – MUHAMMAD QASIM KHAN Jun 20 '20 at 22:50
  • @mikewhatever Hi there, thanks for sharing your views. Can you guide me how can I select a kernel on reboot. Because, I rebooted several times and I couldn't find an option. Thanks – MUHAMMAD QASIM KHAN Jun 20 '20 at 22:54
  • I misinterpreted what @mikewhatever was trying to say. If you use grub, you need to make it show up during boot so that you can select the kernel. If you are going to do kernel work, then make grub always visible during boot and have a reasonable timeout. There are a great many answers already about how. To install, I have only ever installed the .deb files via dpkg. – Doug Smythies Jun 20 '20 at 23:32
  • For kernel work I would suggest this method. – Doug Smythies Jun 20 '20 at 23:42
  • I somehow managed to edit the grub file and rebooted it. But now, it's frozen. It's not even starting. Is there a way to fix this from boot options or anything? I messed it up pretty bad, i think. And I didn't make it show up during the boot. I just edited the GRUB_DEFAULT="kernel_name" – MUHAMMAD QASIM KHAN Jun 20 '20 at 23:46

1 Answers1

0

If you want to use another installed kernel, you need to choose it in the GRUB boot menu:

  1. During boot, hold down either ESC (for EFI systems) or Shift (for BIOS systems).

  2. Select "Advanced options for Ubuntu"

  3. Select the kernel you wish to use.

Nmath
  • 12,333