Since my kernel got upgraded to 5.18.10 I started encountering many bugs on my 2013 macbook air which is my main laptop at home. There are graphical glitches, I lost wi-fi connection and camera stopped working. Everything works correctly on kernel kernel-5.17.9-300.fc36.x86_64
Now, I would like to make that kernel the default kernel that computer automatically boots to. I have computer users at home who are a not tech-savvy & don’t know what grub boot menu is or which kernel to choose.
I followed multiple guidelines. First i deleted the newer kernel and locked the current kernel. Below you can find commands I used:
Unfortunately following it reinstalled the version of the kernel that I previously deleted. Good news is that wifi works on all kernel versions now. What I would ultimately like to do is to:
Configure grub so it automatically boots to the correct kernel
Delete other unused kernel versions (if it won’t break the wifi again)
I already know how to do #2 but I am not sure how to go about step 1 mentioned above. I followed multiple tutorials and none of them seems to be producing satisfying results. I used grubby, edited /etc/default/grub and did a couple other things… Would someone be willing to help me with that?
Current output:
[asti@fedora ~]$ rpm -q kernel
kernel-5.17.9-300.fc36.x86_64
[asti@fedora ~]$ uname -sr
Linux 5.17.9-300.fc36.x86_64
Yet my boot-menu still shows 3 different kernels and boots automatically to the newer one that is highlighted first. I am still a newbie when it comes to Fedora (been using Linux for 2 years now) and Engiish is my second language, so I am sorry if I made any mistakes in this description.
Than:
[asti@fedora ~]$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file …
Found Mac OS X on /dev/sda1
Adding boot menu entry for UEFI Firmware Settings …
done
After a reboot, I clicked on the correct, older version of the kernel and than after short use rebooted again. The grub-menu still pops-up and system boots to the first highlighted kernel which is 5.18.10. So nothing changed…
Maybe I am missing something obvious? I already used that command (as described in my second post) and nothing changed. The boot-menu still shows up and the first highlighted kernel (which is 5.18.10) is booting if I don’t do anything. So it doesn’t seem to work.
Here’s the output. Some stuff that is showing in terminal is in Polish. Rebooting soon.
EDIT: Same behaviour after reboot. Maybe I should edit grub-menu so it times out after 0 seconds? Maybe that will lead to loading correct kernel automatically?
/boot/loader:
razem 4
drwx------. 2 root root 4096 07-14 08:18 entries
ls: nie można otworzyć katalogu ‘/boot/loader/entries’: Brak dostępu
ls: nie można otworzyć katalogu ‘/boot/lost+found’: Brak dostępu
This is a Macbook so maybe there’s an OSX recovery partition left there, but I am quite sure I formatted the whole SSD when I was installing linux. Output from commands below:
Since the release of fedora 34 the primary grub.cfg file has resided at /boot/grub2/grub.cfg and the file at /boot/efi/EFI/fedora/grub.cfg has been a pointer that redirects grub on those systems to the other file. Replacing the one under /boot/efi causes problems.
I followed these instructions: GRUB 2 - Fedora Project Wiki and after doing that, the system seems to automatically pick the last option I have chosen in grub. So if I choose the correct kernel, it comes back to it and highlights it after a reboot. If I choose newer kernel, than it automatically highlights this kernel after a reboot. Is that the correct type of behaviour?
Is there a way to delete all other kernels from grub just to make sure none of my family members messes things up? I tried to do that before following the tutorials but didn’t suceeed.
You really do not want to do that (although you can).
Fedora by default only keeps 3 installed kernels and that is so that if a new kernel update breaks the system the user can boot to the earlier kernel for recovery. It also requires a minimum of 2 kernels – the one booted from at time of update and the newly installed one. The rescue kernel should never be selected by default.
The best way is to tell them to let the system boot automatically from power on and it will boot properly. Also tell them if they select a different kernel in the grub menu it may not boot properly.
They should be able to learn that a few moments wait during boot is better than breaking the system. You might also suggest they power on then walk away until the login screen appears.
If you really, really want to remove an installed kernel the command is sudo dnf remove kernel*VERSION where you would replace VERSION with something like ‘5.18.5’ or similar for whichever kernel you want to remove. Dnf should refuse to remove the currently booted kernel.
You also can edit /etc/dnf/dnf.conf and change the line installonly_limit=3 to installonly_limit=2 if you only want to keep the kernel you are currently booted from and the latest being installed.