GRUB: Changing the Default Kernel
Serge Y. Stroobandt
Copyright 2013–2016, licensed under Creative Commons BY-NC-SA
- Home
- Information Technology
- Desktop Systems
- Changing Default Kernel
Introduction
GNU GRUB (short for GNU GRand Unified Bootloader) is the boot loader of most GNU/Linux distributions. It gives a user the choice to boot one of multiple operating systems or select a specific kernel configuration available on a disk partition of the computer system.
Now, suppose you just upgraded your rolling release GNU/Linux distribution. The upgrade also included a new version of the Linux kernel. By default, GRUB will choose the latest kernel to boot after its menu time-out.
Occasionally, a new kernel might break a custom-installed package that does not belong to the standard repositories. Furthermore, it might be that you cannot or do no want to solve this issue straight away. More importantly, you do not want to disrupt the daily routine of other users whilst you are figuring things out. As long as you have not removed the older version of the kernel, you could configure GRUB to boot with that older kernel by default. Here is how it is done.
Start counting from zero
Edit /etc/default/grub
with administrative privileges:
Look for the line containing GRUB_DEFAULT=0
. Change the number knowing that computers always count starting from zero. In this case, zero corresponds to the latest kernel.
Don’t forget to update-grub
After editing the above configuration file, do not forget to run update-grub
to cause an update of /boot/grub/grub.cfg
.
That is all. Now you can sit back and solve the broken package issue in a relaxed way, perhaps even remotely via OpenSSH. By the way, full details of the options that are available in the /etc/default/grub
configuration file can be obtained by typing:
or, more conveniently, by clicking this link.
This work is licensed under a Creative Commons Attribution‑NonCommercial‑ShareAlike 4.0 International License.
Other licensing available on request.
Unless otherwise stated, all originally authored software on this site is licensed under the terms of GNU GPL version 3.
This static web site has no backend database.
Hence, no personal data is collected and GDPR compliance is met.
Moreover, this domain does not set any first party cookies.
All Google ads shown on this web site are, irrespective of your location,
restricted in data processing to meet compliance with the CCPA and GDPR.
However, Google AdSense may set third party cookies for traffic analysis and
use JavaScript to obtain a unique set of browser data.
Your browser can be configured to block third party cookies.
Furthermore, installing an ad blocker like EFF's Privacy Badger
will block the JavaScript of ads.
Google's ad policies can be found here.
transcoded by to make it run as secure JavaScript in the browser.