16

I tried to update Firefox Snap (from 100 to 101):

sudo snap refresh firefox

but I got a message that an update was pending, but it could not update because Firefox was running an app, although I did close all Firefox windows and I couldn't find anything with pgrep firefox

After a reboot, the update command was working.

So, how do you update Firefox on Ubuntu 22.04 without restarting the system?

Janghou
  • 5,709
  • I'm having the same issue with kubuntu. – mahen23 Jun 01 '22 at 16:06
  • I received repeated messages that an update to Firefox was pending, but I ignored them because I didn't want to reboot yet. Closing Firefox didn't stop these messages from repeating, and neither did running sudo apt update & sudo apt upgrade. In my case only restarting Ubuntu worked. After rebooting Ubuntu the Firefox snap package was updated from 100 to 101 right away. – karel Jun 02 '22 at 05:54
  • Even after rebooting, the update is not installed in my case. – MPi Jun 02 '22 at 07:16
  • 1
    I had the same issue, but after closing firefox, checking with pgrep that it was terminated, sudo snap refresh firefox worked smoothly. I wonder why they chose to move to snap with the firefox package. It's all worked so smoothly with apt over the past years. :) – mfg Aug 25 '22 at 06:26

2 Answers2

7

I had a similar issue, but I was simply being neglectful about closing Firefox.

However, I recommend using something like pkill firefox or killall firefox in the future to see if that'll close all instances of Firefox to stop it from complaining.

1

Quit the application -- in this case, snap-store (a.k.a. Ubuntu Software). Since snap-store auto-starts upon login, you might not recall that you have it open...but you do.

Closing the window is not enough to terminate the application.

One way: On the command line, run snap-store --quit

Another way: Open Ubuntu Software, look at the top bar, find "Ubuntu Software" on the left side of the top bar. Click it, and select "Quit".

Run sudo snap refresh. Let the command complete.

If, instead of a refresh, you still get a pop-up that the application needs to be refreshed, then run sudo snap refresh firefox. The output of that command will return the PID causing the block. Use kill <pid> to remove the block. Run sudo snap refresh again. This time it should work.

It's now safe to re-launch your application.

Joepie Es
  • 1,460