Dumb question

Can linux update programs that are running?

Like i remember programs not being able to be updated runnin in Windows. I was curious if it’s the same in linux in general.

Ubuntu specifically

2 Likes

Replacing something that is running seems problematic. I would guess the system would download everything needed and deal with it the next time you close the application. But I have never really looked into it in detail.

1 Like

Yeah, that’s not really a thing in Linux. The system will just keep on running with the old version of the file in most cases. I wouldn’t want to run it that way for an extended period of time without restarting the affected service, or taking some other action to return the system to a known working state, but I don’t think that’s what you have in mind.

I’ve heard DLLHell isn’t really a thing in windows these days either, but I don’t run windows on the hardware anymore, so I haven’t really looked into it.

There is “Live” patching, that can keep a system running while the Kernel is updated. Programs can bu updated, but typically would spin up a new instance, hand over and close the old one.

It’s easier to make the user reboot than to code it, so that’s typically the choice.

But I have not come across a distribution that forced-rebooted when an upgrade/update happened, like Windows does

Fedora does this

I heard from a friend I didn’t have to restart the program after I installed updates. I was dubious cause I came from Windows a few years ago. So every time my linux box had updates i was just restarting my pc every time I had updates. Glad to know it’s not a requirement anymore. And can just restart the application instead of the whole machine.

Forces you to automatically reboots after an update? like on a timer?

I only got nags, for the short time I used it.
It never switched off overnight for me, but I’ll take your word for it

[edited]

One does still need to reboot, but I beleive it allows for a better choice of when.

But I am probably wrong, if Fedora automatically reboots, maybe others do too.

And some updates will require a reboot quicker than others

Not automatically be default, I’m not sure if functionality breaks down or not if you keep going against the system, but the updates require a reboot. It probably should force a scheduled reboot to be honest.

You can turn it off I think and install a plug-in to notify you of all the services and programs that need restarted.

1 Like

I guess the problem is not so much the system, it’s user behaviour.

Where I might wind up a project and reboot within minutes of an update, I know my colleagues would put it off for Days, or for ever if able…

And safer to have the inconvenience of a rebooted, but up to date system, than one that is not in a stable state.

I just rail against it, because I can;t trust my work computer to do a project overnight or whatever.

And I should be less curmudgeonly / luddite-ish. Updates are good. Updates show the devs still care enough to maintain, not dump it like a bad android port…

1 Like

Just set your computer to delay updates :man_shrugging: i do that whenever i need to run an overnight job.

Fedora does a reboot if you update through the Gnome GUI Software app.

If you use sudo dnf upgrade -y from the command line, no reboot is needed.

Ye, but if a program has to reset it’ll tell you.

How is that a dumb question?

In Linux when a file is replaced on disk, programs which have already opened the old file keep it open. It still exists, but it has no name on disk. When all programs close the file, it is deleted.

What that means though, is that if you have a service running, like a web server, and it is updated, you do need to restart it in order to start using the new version. Otherwise, you could think you’ve updated to the new version with the security patches, but the one you’re running is actually still vulnerable.

Most RPM and DEB packages do a restart of affected services. However, if it is a security fix in a library like OpenSSL it gets iffier because it is less common to script a service restart on library updates.

For kernel updates the easiest is to reboot. There are live patches but someone has to write those. The kind of thing where you might have to freeze the kernel execution and rewrite the process list in-memory structures always seemed pretty iffy to me. If uptime is so important in that case, redundant machine clusters seem to be a much better idea.

3 Likes

You still nee to restart services though, it won’t necessarily restart them automatically, and by default Fedora won’t tell you which. Just something to keep in mind. But workstation is for end users so honestly nothing wrong with a quick and easy reboot

Can linux update programs that are running?

Yes.

When you launch an application or daemon on Linux, it loads the version saved on disk into memory. That version runs until you close it.

When you update the application saved on disk while also running a version in memory, the version in memory continues to run (bugs and all) until it is closed. The next time you launch it, the new version will be loaded into memory.

When updating only a single application, restarting that application is sufficent. Reboots aren’t required. This is also true of system services; restarting or reloading is all that is required.

Some applications, like Firefox, will prompt you to restart automatically when an update gets applied to disk.

Without using specific, advanced patching tools, you should reboot when kernel or init updates are applied.

2 Likes