I just did a system update (sudo dnf upgrade
), where it installed a new kernel and some of it’s modules, with other things. Yet interestingly, dnf never told me that I need to restart my computer… why is that? Is it actually not needed somehow? When I was on other Linux systems, other package managers seemed to warn me about it… (I don’t mean this as a complaint at all, I’m just wondering)
so… if I understood correctly, you have to add need-restarting
to the command in order to be warned?
I don’t feel like most users are going to think of that (or even know it’s a thing), but… well, I guess there must be some reasons it was configured this way.
The less advanced users would be using GUI package managers in order to perform software updates. When using GNOME Software for example, important updates require restarting, and the updates are being applied after restart.
It is expected that dnf
is being used by more advanced users, who know that booting into a new kernel would require a restart.
A user-friendly message at the end of the upgrade process would certainly do no harm.
There is the tracer plugin, but it hasn’t yet been ported to dnf5
https://dnf-plugins-extras.readthedocs.io/en/stable/tracer.html
The suggested way for upgrading is still to do offline upgrades, so a restart is not required there.
well, I’m for sure less advanced, but I use cli out of preference. There could be a lot of others doing that, too. Especially since gnome software tends to be very slow sometimes, users might just prefer cli, once they learn that dnf updating is very simple and easy.
I agree, I think there’s a good reason to add it. Just to ensure that nobody breaks their system.
offline upgrades?.. how can that be performed exactly?..
I currently just do sudo dnf upgrade
, and then I shutdown and powerup my computer. Is that okay as well?..
In this case you could perform offline upgrades, as suggested above:
sudo dnf upgrade --refresh --offline # downloads upgrades packages and prepares the offline transaction
sudo dnf offline reboot # reboots into a minimal environment and applies upgrades in a more safely manner
Without the --offline
flag, the updates are being applied on the live system.
if I never use the --refresh
flag, does dnf ever refresh repositories on it’s own? Because I’ve been doing all my system updates without it since I installed Fedora (which was yesterday).
The --refresh
flag force refreshes the metadata before running the command. If not used, the metadata is being refreshed according to the metadata_expire
variable in the specific repo’s config files. For fedora-updates
repo for example, this is set to 6 hours.
I have always used dnf upgrade --refresh and if there are kernel or other important updates i type reboot in the terminal.
This is what I have done for many years.
I use the restart and not a full power off, but it achieves the same goal.