Score:2

Correct way to update Firefox Snap on 22.04

us flag

I have recently updated to 22.04, which, unlike previous versions, installs Firefox via Snap. My PC is on constantly, and Firefox is usually open.

Every now and then I get a notification telling me that a Firefox update is pending and I should close Firefox. The last time I did that, nothing seemed to happen for several hours until I manually ran sudo snap refresh, which worked fine.

Today I got another update notification. I closed Firefox and immediately ran sudo snap refresh.

However, I am wondering how the devs intended Firefox to be updated – do they really expect users to run snap manually every time they get an update notification? Or should updates happen automatically when the system is rebooted? (And in that case, what about systems which get only infrequent reboots?)

ChanganAuto avatar
us flag
No, they don't expect users to run refresh manually - although they can, of course - because the snap system updates whatever is pending at the next opportunity which most of times is during reboot or shutdown. You'll notice an "install updates and reboot/shutdown?", accept and let it do its thing.
us flag
What if I reboot infrequently? For deb packages, Software Updater will pop up within ~24 hours of an update becoming available and prompt me to install it. Is there anything equivalent for Snap?
ChanganAuto avatar
us flag
The same software updater runs a snap refresh at the very end (and tells you about that). So, don't stress. The system is well designed and much smarter than what you give it credit for.
nb52er avatar
ae flag
Remove firefox snap and use the one from the mozilla's ppa. A lot of ppl have this problem and there's no solution. It's how snapd is designed.
us flag
@ChanganAuto so then, the correct workflow would be to close Firefox when prompted to install updates, before triggering these updates – at least when a new Firefox version is available? (Btw, would Firefox appear in the list of updates?)
ChanganAuto avatar
us flag
Again, snap updates will be installed whenever convenient. If you want it to happen immediately then either run refresh or just the GUI Updates after closing the software being updated, Firefox in this case. No, updates for snaps aren't listed.
Score:8
cn flag

Short Answer:

You get to choose when to terminate the application and run the refresh. You DON'T need to quit the application immediately. You have two weeks to plan a convenient time to Quit and Refresh.

Just don't let the 14-day countdown timer reach zero, or the application will terminate, losing all unsaved work.

More explanation:

Snap packages were not originally developed for long-lived desktop applications. They were adapted for that purpose, and sometimes adaptations surprise everybody with unexpected results.

  • History: Snap packages, formerly called Click packages, were originally developed for phone applications (which are not always active) a decade ago. Then Snaps became popular with servers and small devices, two segments that don't have desktops. The first experiments with Snaps-on-Desktop were for small, limited-use applications like the desktop calculator.

Snap developers did, in fact, intend this behavior beginning in 22.04 because the alternatives were much worse: Either terminate the application to update (looks like a crash to the user), or don't update at all (security risk). You get to choose when to terminate the application and run the refresh. Just don't let the 14-day countdown timer reach zero, or the application will terminate.

Newer releases of Ubuntu have greatly mitigated this issue. Starting in Ubuntu 23.04, developers added a refresh-upon-close trigger. If you Quit the application and then pause to refresh your beverage momentarily, upon returning and re-launching the application will be refreshed.

  • Snap packages MUST refresh. Auto-refresh is a key element of their design. It's one of the most attractive elements to developers, who want to minimize their own support burdens --and user complaints-- by having all users to run a single version of the software regardless of platform. Folks who don't want auto-refresh should not use Snap-packaged software.

Snap handling, like all open-source software, continues to evolve, change, and improve. Developers know about these pain points and are working on them. It can be a slow process --there are a lot of moving parts-- and volunteers to get involved, help, test, and improve the software are welcome.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.