The latest kernel is causing problems with my sound, which worked fine with an older version. As I have only Ubuntu installed, Grub is not getting displayed while booting. How can I manually choose my kernel version while booting?
The simplest way to display your Grub is to press and hold the SHIFT button while booting.
As an alternative, you can always display Grub without it booting any particular kernel:
gksudo gedit /etc/default/grub
change GRUB_TIMEOUT
to -1 and comment out GRUB_HIDDEN_TIMEOUT
finish off by running
sudo update-grub
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
I commented GRUB_HIDDEN_TIMEOUT
and set GRUB_TIMEOUT=0
– acidghostMay 4, 2015 at 10:33
@JonathanHartley GRUB_HIDDEN_TIMEOUT
is defined in /etc/default/grub
– wjandreaAug 8, 2016 at 19:35
SHIFT
does not work with UEFI. Try ESC
.
– yujaiyuSep 14, 2021 at 22:34
Mmm, looks like GRUB_HIDDEN_TIMEOUT
doesn’t seem to exist anymore on 2.04-1ubuntu47
. Setting GRUB_TIMEOUT=-1
works fine.
In Grub 2.04 the setting is called GRUB_TIMEOUT_STYLE=hidden
. Commenting it out is enough.
– Raoul SteffenFeb 14, 2022 at 15:10
Get the currently installed kernel menu entries using below command.
ubuntu:~$ sudo grub-mkconfig | grep -iE "menuentry 'Ubuntu, with Linux" | awk '{print i++ " : "$1, $2, $3, $4, $5, $6, $7}'
0 : menuentry 'Ubuntu, with Linux 5.4.0-80-generic' --class ubuntu
1 : menuentry 'Ubuntu, with Linux 5.4.0-80-generic (recovery mode)'
2 : menuentry 'Ubuntu, with Linux 4.15.0-159-generic' --class ubuntu
3 : menuentry 'Ubuntu, with Linux 4.15.0-159-generic (recovery mode)'
4 : menuentry 'Ubuntu, with Linux 4.15.0-45-generic' --class ubuntu
5 : menuentry 'Ubuntu, with Linux 4.15.0-45-generic (recovery mode)'
Modify the GRUB_DEFAULT=0
value as per your need.
currently my server booted with 5.4.0-80-generic
ubuntu:~# uname -srn
Linux ubuntu 5.4.0-80-generic
so i want to boot my system with 4.15.0-45-generic
which is menu entry 4
modified GRUB_DEFAULT="1>4"
value in /etc/default/grub
executed below command to regenerate a grub config file with modified GRUB_DEFAULT settings.
Explained
"1>4"
format here
sudo update-grub
rebooted the ubuntu system.
sudo systemctl reboot
post reboot my ubuntu server booted with old kernel 4.15.0-45-generic
ubuntu:~# uname -srn
Linux ubuntu 4.15.0-45-generic
- So are you saying that you are changing
/etc/default/grub
by editing the value forGRUB-DEFAULT
, changing it from0
to1>4
? – Amanda Jul 19, 2023 at 16:16
Holding down the Shift key while booting, will display the Grub menu. You can now select an older kernel version.
For selecting an older kernel as the default kernel, please see this post
- 2what if the older kernels are not shown in grub (they were removed)? Does this mean these kernels are not accessible? – Kalamalka Kid Dec 7, 2016 at 5:26
- 2I had to use escape (rather than shift) – Jonathan King Feb 11, 2019 at 13:40
- 1Shift key does not work – Coder Guy Jan 8, 2021 at 9:15
If you have a few Kernels in your system you can set manually what Kernel version will start:
- Reboot your PC with pressed Shift button for display GRUB after BIOS will start. You will see something like:
- Select “Advanced options for Ubuntu” and memorize index of this menu line(count starts from 0) On the picture index is 1
- Select concrete kernel for boot and also memorize index of this menu line(count starts from 0) On the picture index of chosen Kernel is 2
- Start system. This action is for one boot on concrete kernel. If you want to start from concrete Kernel all time you should do next steps:
4.1. Open and edit GRUB setup file:
sudo nano /etc/default/grub
4.2. Find line GRUB_DEFAULT=...
(by default GRUB_DEFAULT=0
) and sets in quotes menu path to concrete Kernel (Remember menu indexes from steps 2 and 3). In my system first index was 1 and second was 2. I set in to GRUB_DEFAULT
GRUB_DEFAULT="1>2"
Save file.
4.3. Update GRUB information for apply changes:
sudo update-grub
4.4. After reboot you automatically boot on Kernel by chosen menu path. An example on my machine 1 -> 2
4.5. Check Kernel version after reboot:
uname -r
I first used GRUB_DEFAULT="Advanced options for Ubuntu > Ubuntu, with Linux x.x.x-xx-generic"
but that didn’t work… Your version with GRUB_DEFAULT=”1>2″ did work! 🙂
– TheQuestionerMar 22, 2022 at 16:39
How to get more items in GRUB menu? What if I want the last four kernels? System is currently broken on last two now.
– mathtickNov 3, 2023 at 13:19
As far as I know all installed kernels should be displayed. Are you sure, another two have been installed or not removed etc?
– JackkobecNov 3, 2023 at 16:45
While booting when GRUB appears with entries select the second entry i.e., Advanced options for Ubuntu there you can see different older kernel versions which was installed previously, you can select one among them which works good for you. Otherwise you go to the grub.cfg and paste your required kernel version on top of currently installed kernel entry. In both ways it works
Please install the previous kernel with the following command:
sudo apt-get install linux-image-3.0.0-12-generic linux-headers-3.0.0-12-generic
Then reboot. You will be prompted to choose your kernel.
This source from : https://askubuntu.com/questions/82140/how-can-i-boot-with-an-older-kernel-version