Ask Your Question

Is it even safe to use dnf upgrade in a graphical shell?

asked 2018-06-13 09:43:26 -0500

mlr1977 gravatar image

Some upgrades require you to restart the system, because it isn't safe to install them when the system shell is running. When you do the upgrades through Gnome Software, the reboot sequence is taken care of for you. But DNF just installs everything immediately and doesn't ask for a reboot. I'm new to Fedora and I've been investigating the update process. Seems like people have had plenty of problems with DNF in the past:

Ideally, I would like to switch to DNF. Gnome Software's packagekit back-end crashes when updating repos (clicking on the refresh button), installations can get stuck permanently, doesn't clean up after itself, doesn't integrate with DNF at all (making dnf rollback impossible), and can't add repositories, and can't install anything except GUI apps. And it doesn't notify you about updates unless you actually open the store app.

All in all, you are practically forced to use dnf, and yet the updates are handled exclusively by gnome software, so you are forced to use both.

So I'd like to use DNF. But I don't want to boot into single-user mode for every update. I would also like to be told whether on not I need to reboot after an update, and I'd like to have a simple gui to review and apply dnf updates.

Isn't there a sane way to handle this?

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted

answered 2018-06-13 20:23:00 -0500

florian gravatar image

if you feel the need, you can always switch to a Virtual Terminal (or Virtual Console) by pressing CTRL+ALT+F3, login and perform your dnf update there. In case gnome shell or any other relevant component crashes, your update will still run through.

edit flag offensive delete link more


No. If you do this, the files that might be in use are still in use in the other session.

tim8723 gravatar imagetim8723 ( 2018-06-14 06:58:13 -0500 )edit

answered 2018-06-13 10:08:49 -0500

aeperezt gravatar image

While it is safe to use graphical upgrade, I do prefer use dnf method, but it is me. Good Luck.

edit flag offensive delete link more


I'm talking about the potential problems with using dnf upgrade from a terminal window running in a DE. What happens if the updates affect core processes and need a reboot to be applied? Gnome Software will schedule the reboot and then the updates will be applied. But how will dnf upgrade handle it? Seems like there were a few cases where DNF just crashed the desktop.

Also do you know if you can use dnf autoremove to clean up after packagekit?

mlr1977 gravatar imagemlr1977 ( 2018-06-13 10:43:42 -0500 )edit

That is not what autoremove does. From man dnf:

 dnf [options] autoremove
          Removes  all  "leaf"  packages  from the system that were originally
          installed as dependencies of user-installed packages but  which  are
          no longer required by any such package.

However it does not always know what was user-installed and what not, and therefore it may decide to remove way too many packages. "leaf" packages are packages that are not needed by some other package.

villykruse gravatar imagevillykruse ( 2018-06-13 11:22:28 -0500 )edit

Never read anything on this forum where dnf crashed an entire desktop. There may be problems when you install software using dnf and Gnome Software because they don't share same transaction database.

florian gravatar imageflorian ( 2018-06-13 13:41:41 -0500 )edit

What type of "clean up after packagekit" do you mean? Something like this is usually not necessary.

And, stay away from dnf autoremove unless you understand what it's doing! It can make you unhappy because it doesn't work the way user expect it to work.

florian gravatar imageflorian ( 2018-06-13 13:53:34 -0500 )edit

by cleaning up i mean removing dependencies. when you remove with dnf it automatically removes unused deps. but packagekit does not, as far as i'm aware

mlr1977 gravatar imagemlr1977 ( 2018-06-13 19:17:14 -0500 )edit

answered 2018-06-13 15:47:46 -0500

muep gravatar image

Run dnf inside a tmux or a screen. Then if the desktop session becomes unstable due to the files changing underneath it, a crash of the desktop session will not take down the terminal and the dnf running in it.

edit flag offensive delete link more

answered 2018-06-13 13:49:14 -0500

florian gravatar image

updated 2018-06-13 13:50:55 -0500

As for your general question: Of course it's safe to apply updates on-the-fly. yum and dnf have been doing that since many years!

You also want to know if you need to restart after applying updates using dnf? Then simply install dnf-plugin-tracer (sudo dnf install dnf-plugin-tracer) It will tell you what processes need a restart.

(Be aware, it slows down your dnf transaction).

There is also a dnf plugin called needs-restarting(See https://dnf-plugins-core.readthedocs....) - you can use that but it's even slower as far as I remember.

Finally you ask for a GUI where you can review the updates. You don't need a GUI for that. Look at dnf update output and hit only 'Y' or 'Enter' when you are ready for updating.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-06-13 09:43:26 -0500

Seen: 82 times

Last updated: Jun 13