Why isn't Firefox Snap updating automatically?

Asked by Stefan Pappalardo

Firefox snap in Ubuntu 22.04 doesn't update automatically. On every available update and after that on every login to Ubuntu I'm notified about an available update for Firefox. This behavior continues until the update was started manually. This is annoying and I don't see any good reason for that behavior. Please help. Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu firefox Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Please note that updating snap packages is independent of the update process for deb packages.

For diagnostic purposes please provide the output that you receive for the commands

uname -a
lsb_release -crid
apt policy firefox
snap list

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

Also give the output of:

sudo apt update
sudo apt full-upgrade

Revision history for this message
Stefan Pappalardo (sjuk) said :
#3

$ uname -a
Linux asterix 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

$ apt policy firefox
firefox:
  Installiert: 1:1snap1-0ubuntu2
  Installationskandidat: 1:1snap1-0ubuntu2
  Versionstabelle:
 *** 1:1snap1-0ubuntu2 500
        500 http://de.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status

$ snap list
Name Version Revision Tracking Herausgeber Hinweise
ausweisapp2-ce 1.26.7 175 latest/stable glasen -
bare 1.0 5 latest/stable canonical✓ base
canonical-livepatch 10.7.0 246 latest/stable canonical✓ -
codium 1.84.2.23317 362 latest/stable vscodium classic
core 16-2.60.4 16202 latest/stable canonical✓ core
core18 20231027 2812 latest/stable canonical✓ base
core20 20231123 2105 latest/stable canonical✓ base
core22 20231123 1033 latest/stable canonical✓ base
firefox 122.0-2 3687 latest/stable mozilla✓ -
gnome-3-38-2004 0+git.efb213a 143 latest/stable canonical✓ -
gnome-42-2204 0+git.ff35a85 141 latest/stable canonical✓ -
gtk-common-themes 0.1-81-g442e511 1535 latest/stable canonical✓ -
powershell 7.4.1 262 latest/stable microsoft-powershell✓ classic
rpi-imager 1.8.4 584 latest/stable waveform -
signal-desktop 6.44.1 606 latest/stable snapcrafters✪ -
snap-store 41.3-71-g709398e 959 latest/stable canonical✓ -

$ sudo apt update
Holen:1 http://download.opensuse.org/repositories/home:/FrodeSolheim:/stable/xUbuntu_22.04 InRelease [1.557 B]
OK:2 http://de.archive.ubuntu.com/ubuntu jammy InRelease
OK:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
OK:4 http://de.archive.ubuntu.com/ubuntu jammy-updates InRelease
OK:5 http://de.archive.ubuntu.com/ubuntu jammy-backports InRelease
OK:6 https://dl.google.com/linux/chrome/deb stable InRelease
OK:7 https://esm.ubuntu.com/apps/ubuntu jammy-apps-security InRelease
OK:8 https://esm.ubuntu.com/apps/ubuntu jammy-apps-updates InRelease
OK:9 https://esm.ubuntu.com/infra/ubuntu jammy-infra-security InRelease
OK:10 https://esm.ubuntu.com/infra/ubuntu jammy-infra-updates InRelease
Es wurden 1.557 B in 1 s geholt (1.975 B/s).
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Aktualisierung für 1 Paket verfügbar. Führen Sie »apt list --upgradable« aus, um es anzuzeigen.

$ sudo apt full-upgrade
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
Paketaktualisierung (Upgrade) wird berechnet… Fertig
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

All. I can suggest is to remove the snap then use this
https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04

It'll install the deb version and should be OK. I've not used Firefox in years and nothing I use comes as a snap so I can't personally comment on snap updates etc.

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

To initiate a update of the snap packages open a terminal and isue the command

sudo snap refresh

Usually a check for available updates of the snap packages (and an update if there are any) is initiated automatically every few hours.

Revision history for this message
Stefan Pappalardo (sjuk) said :
#6

Dear Andrew & Manfred: Many thanks for your answers. But none of the answers is a reply to my question.

@Andrew:
I didn't ask for a workaround with an additional PPA only to get back the expected behavior of automatic software updates for Firefox.

@Manfred:
I thought I stated clearly that updating the Firefox snap package is annoying and unexpected. Maybe I was not precise enough.
I don't want to update the snap package manually (not in terminal and not in snap-store).

I asked for a good reason "Why isn't Firefox Snap updating automatically?".

Firefox is currently installed by default in the Ubuntu way: Deb package which installs the snap package.
So far so good. But the snap package for Firefox doesn't update automatically. (All other installed snaps does.)
This is unexpected from end user perspective. If there is no special reason for that this there is an issue that should be fixed.

I hope that helps to clarify the question.

Revision history for this message
Launchpad Janitor (janitor) said :
#7

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Stefan Pappalardo (sjuk) said :
#8

I still need an Answer.

Revision history for this message
Best Manfred Hampl (m-hampl) said (last edit ):
#9

It was not clear to me (until your last comment) that all other snaps are automatically updated and just firefox behaves differently.

In that case i want to suggest that you uninstall and re-install the firefox snap.

Revision history for this message
Stefan Pappalardo (sjuk) said :
#10

$ snap remove firefox
firefox entfernt

$ snap install firefox
firefox 122.0.1-1 aus Mozilla✓ installiert

Now we need to wait for next update and if it will be performed automatically.

Revision history for this message
Stefan Pappalardo (sjuk) said (last edit ):
#11

Here we go. Re-installation of Firefox didn't help. Next version just sits and waits for manual update reminding on every login.

$ snap info firefox
name: firefox
summary: Mozilla Firefox web browser
publisher: Mozilla✓
store-url: https://snapcraft.io/firefox
contact: https://support.mozilla.org/kb/file-bug-report-or-feature-request-mozilla
license: unset
description: |
  Firefox is a powerful, extensible web browser with support for modern web application
  technologies.
commands:
  - firefox
  - firefox.geckodriver
snap-id: 3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk
tracking: latest/stable
refresh-date: vor 10 Tagen, um 11:50 CET
channels:
  latest/stable: 123.0-3 2024-02-20 (3836) 279MB -
  latest/candidate: 123.0-3 2024-02-14 (3836) 279MB -
  latest/beta: 124.0b1-1 2024-02-19 (3865) 281MB -
  latest/edge: 124.0a1 2024-02-19 (3863) 298MB -
  esr/stable: 115.8.0esr-1 2024-02-20 (3827) 256MB -
  esr/candidate: 115.8.0esr-1 2024-02-13 (3827) 256MB -
  esr/beta: ↑
  esr/edge: ↑
installed: 122.0.1-1 (3779) 275MB -

Revision history for this message
Manfred Hampl (m-hampl) said :
#12

Maybe there is some useful information in the system logs, e.g. with the command
sudo journalctl -u snapd --no-pager

Revision history for this message
Stefan Pappalardo (sjuk) said :
#13
Revision history for this message
Manfred Hampl (m-hampl) said :
#14

stateengine.go:149: state ensure error: Get "https://api.snapcraft.io/api/v1/snaps/sections": dial tcp: lookup api.snapcraft.io: no such host

It seems that at the moment when the snap demon tries to update firefox and other snaps (which is very early after boot), there is no network connection and thus it fails.
What kind of network connection do you have?

Revision history for this message
Stefan Pappalardo (sjuk) said :
#15

The snap package for Firefox doesn't update automatically. All other installed snaps does.
Kind of network connection: Wired 1000Mb/s.

Revision history for this message
Manfred Hampl (m-hampl) said :
#16

The logs do not indicate anything special for firefox.

My interpretation of what I see is the following:

You boot the system and for whatever reason at the time when the snap demon tries updating the snaps, you do not have network connection. Thus the update aborts and the update attempt is re-scheduled for some minutes later. This prevents the update of all snaps.
When you then start firefox, firefox is doing an availablility check and warns that a new version is available. This would be valid also for all other snaps, but they do not warn about a new version.

The problem now is that the firefox snap cannot be updated while you have firefox running, see e.g. https://askubuntu.com/q/1412140

Repeating my previous question in a different way:
Is there anything special with your network connection, such that short after boot time the network connection is not yet available?

Revision history for this message
Stefan Pappalardo (sjuk) said :
#17

Dear Manfred, Please forgive my directness. But your interpretation does not make much sense.
Updating snaps will never happen on boot. See the link for more details: https://wiki.ubuntuusers.de/snap/Updateverwaltung/
And I personally use another internet browser. Firefox is only for other users.
I can 100% confirm that Firefox was not used during update. The Problem is that the update never starts.

As the Firefox snap is affected exclusively I think it must be something with the Firefox snap package itself.
But I have no idea on how to check if and why the maintainer of the snap decided to deactivate the auto-update.

Revision history for this message
Stefan Pappalardo (sjuk) said (last edit ):
#18

Maybe I was not patient enough or the Firefox snap package was adjusted.
But yesterday the Firefox snap package was automatically updated.

$ snap changes
ID Status Spawn Bereit Zusammenfassung
193 Done gestern um 23:24 CET gestern um 23:25 CET Automatisch Snap "firefox" auffrischen

To reproduce the issue I installed Ubuntu 22.04 in a virtual machine.
This time Firefox was updated after a while but core22 not.

$ snap refresh --time
timer: 00:00~24:00/24
last: heute um 18:03 CET
next: heute um 19:04 CET

$ snap list
Name Version Revision Tracking Herausgeber Hinweise
bare 1.0 5 latest/stable canonical\u2713 base
core20 20240111 2182 latest/stable canonical\u2713 base
core22 20230725 858 latest/stable canonical\u2713 base
firefox 123.0-3 3836 latest/stable/\u2026 mozilla\u2713 -
gnome-3-38-2004 0+git.efb213a 143 latest/stable/\u2026 canonical\u2713 -
gnome-42-2204 0+git.ff35a85 141 latest/stable/\u2026 canonical\u2713 -
gtk-common-themes 0.1-81-g442e511 1535 latest/stable/\u2026 canonical\u2713 -
snap-store 41.3-71-g709398e 959 latest/stable/\u2026 canonical\u2713 -
snapd 2.61.1 20671 latest/stable canonical\u2713 snapd
snapd-desktop-integration 0.9 83 latest/stable/\u2026 canonical\u2713 -

$ snap changes
ID Status Spawn Bereit Zusammenfassung
1 Done 2023-08-08 heute um 17:16 CET Initialize system state
2 Done heute um 17:15 CET heute um 17:15 CET Initialize device
3 Done heute um 17:49 CET heute um 17:49 CET Change configuration of "core" snap
4 Done heute um 17:52 CET heute um 17:52 CET Remove auto-refresh hold on all snaps
5 Done heute um 17:52 CET heute um 17:53 CET Snaps automatisch auffrischen: "core20", "gnome-42-2204", "snapd"
6 Done heute um 18:03 CET heute um 18:04 CET Automatisch Snap "firefox" auffrischen

I will let the machine open and check again after 19:04.

Revision history for this message
Stefan Pappalardo (sjuk) said :
#19

This is weird. Now in the virtual machine it's core22 which is not updating automatically.
I don't understand how snapd decides to automatically update or not.

Revision history for this message
Stefan Pappalardo (sjuk) said :
#20

On the virtual machine now the core22 snap is not updating for unknown reason. There were several chances for an update.
Maybe this is the standard behavior for snap. But from my perspective it appears to be unexpected.

$ snap refresh --time
timer: 00:00~24:00/24
last: heute um 13:49 CET
next: heute um 14:36 CET

$ snap refresh --time
timer: 00:00~24:00/24
last: heute um 15:24 CET
next: heute um 16:20 CET

$ snap changes
keine Änderungen gefunden

$ snap info core22
name: core22
summary: Runtime environment based on Ubuntu 22.04
publisher: Canonical\u2713
store-url: https://snapcraft.io/core22
license: unset
description: |
  The base snap based on the Ubuntu 22.04 release.
type: base
snap-id: amcUKQILKXHHTlmSa7NMdnXSx02dNeeT
tracking: latest/stable
refresh-date: vor 3 Tagen, um 17:02 CET
channels:
  latest/stable: 20240111 2024-02-14 (1122) 77MB -
  latest/candidate: 20240111 2024-02-09 (1122) 77MB -
  latest/beta: 20240206 2024-02-09 (1194) 77MB -
  latest/edge: 20240222 2024-02-22 (1262) 77MB -
  fips-updates/stable: 20231019 2023-11-03 (952) 78MB -
  fips-updates/candidate: \u2191
  fips-updates/beta: \u2191
  fips-updates/edge: \u2191
  fips-preview/stable: 20231019 2023-11-03 (952) 78MB -
  fips-preview/candidate: \u2191
  fips-preview/beta: \u2191
  fips-preview/edge: \u2191
  fips/stable: \u2013
  fips/candidate: \u2013
  fips/beta: \u2013
  fips/edge: 20231019 2023-11-03 (952) 78MB -
installed: 20230725 (858) 77MB base

Revision history for this message
Stefan Pappalardo (sjuk) said :
#21

@Manfred Hampl: First of all. Many thanks for your help, especially for your openness and patience. :-)
I guess the snap remove & install firefox was the solution of the issue.

FYI: The issue with the core22 in the fresh virtual machine still remains. But I don't care because this was not the question. ;-)
I will experiment a little bit with the virtual machine. Maybe I get some new insights on how snap is refreshing its packages.

Revision history for this message
Stefan Pappalardo (sjuk) said :
#22

Thanks Manfred Hampl, that solved my question.