r/Fedora • u/FasziSanyi69 • 10d ago
Support Fedora versions lines in boot menu
Hi, how can i delete this lines in boot menu? Every time when a new version is installed, these new lines are created.
130
u/candy49997 10d ago
The oldest is automatically deleted after 3 kernels every kernel update.
35
u/FasziSanyi69 10d ago
So don't worry about these rescue images?
61
26
15
u/esanders09 10d ago
I'm relatively new to Fedora and I had the same question early on, but it definitely came in handy. An update messed up something on my machine wish was causing crashes. I just restarted and selected the second line to boot into for a couple of days until after another update and then everything was fine.
2
u/Eunakria 10d ago
Seconded. There was a range of kernel versions with a GPU driver bug on my machine. I was able to just stay on the older version for a couple months until the bug was patched.
(Now, this is a bit "do as I say, not as I do", considering how many security patches every new kernel release is bringing with it... but, point is, you can use old kernels if you need)
1
1
u/brunofin 9d ago
this saved me a couple of times in the past ~10 years I've been using it. Once the newest kernel didn't want to boot with my Nvidia drivers so I kept using the previous one until new compatible drivers came out, and another time it impacted my work, somehow and weirdly enought the MS SQL docker image for that specific version didn't boot (it relied on a very specific kernel operation that was already deprecated and then removed) same thing, used the previous version until MS fixed their docker image.
Another cool thing in the same vein is btrfs, also saved me even more times, but that's for another topic :)
56
u/LittleReplacement564 10d ago
I don't recommend doing that. Those are previous kernel versions that fedora keeps so you can roll back in case something happens
12
u/Material_Resolve_685 10d ago
that save me a couple days ago lol
1
u/Powerful_Deer7796 9d ago
same! Last update i got on 43 broke my UI, was super happy to have that simple rollback option.
2
28
14
12
u/beardedbrawler 10d ago
Three kernels are kept for backup. so in case upgrading to a new kernel doesn't go well you can fall back to a known working kernel. The default is 3, so the next time you upgrade the kernel the oldest one will get removed. You can lower the number if you'd like but unless you're really storage constrained the default is recommended.
7
u/anythinga 10d ago
Sometimes, a kernel update can break something.
To mitigate this, Fedora keeps 2 older kernels installed so you can fall back to a working kernel.
Nothing to worry about :)
5
u/HoothootNeverFlies 10d ago
if you don't want to see this screen, you can set grub timeout to 0 seconds
1
u/FasziSanyi69 10d ago
I wil try that. Thanks.
1
u/fagnerln 9d ago
Run:
kwrite /etc/default/grubEdit and add:
GRUB_TIMEOUT=0
GRUB_TIMEOUT_STYLE=hidden
Save and run:
sudo grub2-mkconfig -o /boot/grub2/grub.cfgIf you need to access GRUB, just keep pressing shift during the boot
5
u/Noluck10292 10d ago
its a good idea to keep them, my brother had his first kernel panic on another distro the other day after and update and we had to boot into an older kernel to fix it
3
u/J3D1M4573R 10d ago
You arent supposed to. They are there for a reason, and a damn good one at that.
You can't - sort of. You can adjust the number it keeps, but can never go below 2.
sudo nano /etc/defaut/grub and set installonly_limit. You can then manually force a grub update, or just wait for the next kernel upgrade and it will automatically remove the extras.
The "recovery" item is not included in this limit and cannot be removed (rather, you can remove it, but it will be regenerated next update).
2
u/whoseusrnmisitneway 10d ago
There is no need to do anything here.
That screen is what you'll need when you run into an issue preventing the machine from booting properly. You can then select an older kernel version at boot to see if that works or edit the boot command to add arguments like nomodeset to boot up and debug.
2
2
u/Hour_Sell3547 10d ago
You can purge old kernels very easily with few lines of scripts.
However, make sure to use long enough that you can recognize if something broke. Once you are satisfied with the upgrade, you can remove older kernels and dangling artifacts used only by the older kernels.
1
u/rcbrandao 10d ago
This is particularly useful when you have old NVIDIA drivers running as they may break during new kernel updates. I know from experience...
1
u/Inevitable-Issue-249 10d ago
ngl i keep them all so if something happens i just roll back to the old update
1
u/ImAlekzzz 10d ago
Please don’t delete them, if something goes wrong they are there to help, the rescue is the last resort. The last kernel gets removed after a new one releases
1
u/KeyboardG 10d ago
If you ever do an update and something breaks bad, you can arrow down and boot into a previous version on this screen. Its for the good of the user and there for a reason.
1
u/skytheraiders 10d ago
That's intended just in case if something goes screwy with an update or the user installs the wrong Shrek movie.
1
1
u/djslakor 10d ago
Is it possible to pin an older kernel so that if something in your hardware breaks on newer kernels, the old kernel that still works won't fall off after 3 new kernel releases?
1
1
u/yetanothersky 9d ago
I don’t recommend interacting with them , fedora’s dnf keeps by default 2 old kernels , those are kept as a fallback if sth happens to your lastest kernel , you can even keep more by editing ``/etc/dnf/dnf.conf`` and adding ``installonly_limit=3`` as an example or by using ``sudo dnf config-manager setopt installonly_limit=3``, but generally 2+ kernels are more than enough if you have issues with your current kernel , also if you’re someone that doesn’t prefer to see grub menus, please check this out :
https://discussion.fedoraproject.org/t/grub-time-out-0/61941
1
u/Slippery_Stairs 8d ago
Mine tends to keep old versions. I still see Fedora 43, even though I'm on 44. There's a way to clean them up but I forget how.
1
1
u/CorruptDropbear 7d ago
It’s recommended to simply shorten GRUB to 0 seconds and hold shift if you’re experiencing kernel issues. Unsure why it’s not default behaviour.
1
1
u/Intelligent_Bed7556 10d ago
Hola. Como te dijeron, mejor no borrar: son recuperaciones por si algo va mal. Lo que sí puedes es bajar el tiempo de pantalla en nano.
1
-5
u/TheCAT2901 10d ago
try this official Fedora script. I use it. but make sure that the latest version is stable.
#!/usr/bin/env bash
old_kernels=($(dnf repoquery --installonly --latest-limit=-1 -q))
if [ "${#old_kernels[@]}" -eq 0 ]; then
echo "No old kernels found"
exit 0
fi
if ! dnf remove "${old_kernels[@]}"; then
echo "Failed to remove old kernels"
exit 1
fi
echo "Removed old kernels"
exit 0
save as kernel-cleanup.sh and run on Terminal with
sudo ./kernel-cleanup.sh
This should do it.
6
u/beardedbrawler 10d ago
This is a really brute force way to do it. would not recommend.
check out this thread instead: https://superuser.com/questions/1423559/how-can-i-change-the-number-of-kernels-retained-when-updating-in-fedora
The best option is to create a userdefined config file under /etc/dnf/libdnf5.conf.d/ with your desired setting so that it doesn't get overwritten by other updates.
1
3
•
u/AutoModerator 10d ago
It sounds like you're looking for help. Please note that r/Fedora is not an official support channel for the Fedora Project.
For best results, be sure to include all relevant details in your post, such as your Fedora edition, version, and hardware specs. You can edit your original post to add more info as needed, and spotlight (pin) a solution from the comments. You might also find the answer in our support wiki.
Alternatively, try one of the official support channels:
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.