Is it okay to run dnf upgrade without --offline flag?


As you can see, I often run dnf upgrade with --offline flag. If you ask why, then it’s a habit from Windows (new linux user btw).

Now I discovered Topgrade, it has everything that I need, it can upgrade anything and I need this.

But the problem with Topgrade is it didn’t have --offline and/or --refresh flags for dnf upgrade command, so it only runs dnf upgrade.

now I’m little scared to run dnf upgrade without --offline flag if the upgrade contain system packages.

I mostly run upgrades in a running system (i.e., not using dnf upgrade --offline or rather dnf offline-upgrade download). Linux isn’t Windows, it can overwrite files that are currently open. I have never really had any problems with this strategy.

However, the new file(s) will only be used the next time they are opened. So, if a central component is upgraded, say glibc, you would have to restart every process that has a handle open for the old version (which is most processes) to get it to use the new version.

If I notice something like this in dnf’s summary, or if the kernel is upgraded, I often interrupt the upgrade and start an offline upgrade instead. Because then I don’t have to worry that I missed an existing process and didn’t restart it, which still has an open handle to a vulnerable library.

4 Likes

I see. So it upgraded but it still uses older version until we restart? Or in other words, the packages in storage has been upgraded but in RAM (that currently running), it still uses older version.

That’s my understanding.

Until you (re)start a process (or the whole system in case of an updated kernel, but that is a special case anyway).

The way it works is this: when a process opens a file on Linux, it holds a handle to that file. The file isn’t in RAM at this point (ignoring caching). After that, you can delete the file from the filesystem, no problem. But the existing handle can still be used to interact (read, write) with the file.

If we are talking about something like a library, an upgrade would replace the library. So any new process would get a handle for the new file with the new contents. But any handle that existed before the upgrade still sees the old file and the old contents.

Got it. Will use topgrade from now. Thanks.

Looks like Linux is more flexible than Windows in this case.