Snap keeps uninstalling apt Firefox, and reinstalling snap Firefox

Bug #1999308 reported by Paul Harrison
44
This bug affects 9 people
Affects Status Importance Assigned to Milestone
firefox (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

 I have looked on various forums including the search features of
Launchpad, help.ubuntu..com, and Google for answers on this but not been
able to.

I have uninstalled the snap of firefox multiple times, installing the real
Firefox from ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/, only for a
few days later (once hours later) for snap to uninstall the real thing and
install its snap version instead.

I have tried a basic
   sudo snap remove firefox

and when that didn't work
   sudo snap disable firefox
   sudo snap remove --purget firefox

The former should be enough - that's a direct expression of my preferences,
some thing like "You should have typed sudo snap remove --do-not-reinstall
--disable-auto-ignore-preferences firefox" would not resolve this bug.

When installing using apt-get, the correct version is being installed, and
snap afterwards does not show the presence of firefox:

Get:1 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64
xul-ext-ubufox all 3.4-0ubuntu1.17.10.1 [3,320 B]
Get:2 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main
amd64 firefox-locale-en amd64 108.0+build2-0ubuntu0.22.04.1~mt1 [831 kB]
Get:3 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main
amd64 firefox amd64 108.0+build2-0ubuntu0.22.04.1~mt1 [64.9 MB]

Name Version Rev Tracking
    Publisher Notes
authy 2.2.2 12 latest/stable
   twilio-authy -
bare 1.0 5 latest/stable
   canonical✓ base
chromium 108.0.5359.94 2238 latest/stable
   canonical✓ -
code 5235c6bb 114 latest/stable
   vscode✓ classic
core 16-2.57.6 14399 latest/stable
   canonical✓ core
core18 20221103 2632 latest/stable
   canonical✓ base
core20 20221123 1738 latest/stable
   canonical✓ base
cups 2.4.2-4 836 latest/stable
   openprinting✓ -
gnome-3-28-1804 3.28.0-19-g98f9e67.98f9e67 161 latest/stable
   canonical✓ -
gnome-3-38-2004 0+git.6f39565 119 latest/stable
   canonical✓ -
gtk-common-themes 0.1-81-g442e511 1535
latest/stable/… canonical✓ -
onlyoffice-desktopeditors 7.2.1 133 latest/stable
   onlyoffice✓ -
snap-store 41.3-66-gfe1e325 638
 latest/stable/… canonical✓ -
snapd 2.57.6 17883 latest/stable
   canonical✓ snapd

/var/lib/snapd/seed/snaps contains (once firefox is removed):

core18_1880.snap gnome-3-34-1804_36.snap gtk-common-themes_1506.snap
 snapd_8542.snap snap-store_467.snap

https://ubuntuhandbook.org/index.php/2021/10/prevent-installing-firefox-snap-ubuntu-mate-21-10/
claims that a similar issue affects Ubuntu MATE 21.04 and the solution was
to type "sudo apt-mark manual firefox", which I have done, but that has not
resolved the problem.

I'm not here to explain why I wouldn't want the snap version, it is clearly
a bug for snap to accept a command to uninstall something and then
automatically reinstall it days later without the permission of the user,
and especially galling that it removes the real version at the same time.

I have lost data (passwords and history) because of this bug, because one
of the many faults of the snap version is that it ignores the user's real
~/.mozilla profile and creates a shadow profile instead inside of the snap
system.

Please disable this behavior. It's obnoxious, it ignores EXPLICITY stated
user preferences, and it causes the loss of data.

I am unclear on what package is causing the behavior so for now marking it
against Firefox, but it could be against some other piece of infrastructure
related to snap:

 affects ubuntu/firefox

Tags: jammy
Paul White (paulw2u)
tags: added: jammy
Revision history for this message
Paul White (paulw2u) wrote :

My recent comment appears to have been lost so I'll repeat by saying that

$ apt policy firefox
firefox:
  Installed: 1:1snap1-0ubuntu2
  Candidate: 1:1snap1-0ubuntu2

on my laptops show the existence of a transitional package that installs a snap version of Firefox. I understand that the '1:' in the version number will override any version number of Firefox obtained from a PPA which uses the conventional version numbering system.

Do you have that 'deb' package installed?

If so, not a bug as the packaging system is designed to do what the Ubuntu developers want it to do, that is replace any 'deb' version of Firefox by a 'snap' version. Uninstalling that 'deb' package will stop a snap being installed in future.

Changed in firefox (Ubuntu):
status: New → Incomplete
Revision history for this message
Paul Harrison (peharri1) wrote :

The output of apt policy firefox on my system is:

firefox:
  Installed: 108.0+build2-0ubuntu0.22.04.1~mt1
  Candidate: 108.0+build2-0ubuntu0.22.04.1~mt1
  Version table:
     1:1snap1-0ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
 *** 108.0+build2-0ubuntu0.22.04.1~mt1 1001
       1001 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Paul Harrison (peharri1) wrote :

Also, in case it helps:

$ dpkg -l firefox*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=================-=================================-============-======================================
ii firefox 108.0+build2-0ubuntu0.22.04.1~mt1 amd64 Safe and easy web browser from Mozilla
un firefox-esr <none> <none> (no description available)
ii firefox-locale-en 108.0+build2-0ubuntu0.22.04.1~mt1 amd64 English language pack for Firefox

From what I can determine the snap transitional package is/was not installed (outside of the upgrade to 22.04, when it was removed and replaced by the version from the PPA)

Revision history for this message
Paul White (paulw2u) wrote :

Thanks for your clarification/confirmation that you have the transitional package available to install but it's currently not installed.

So without the snap or transitional package installed to install the snap you see the snap being installed and/or updated. Strange.

I'm leaving this for the Desktop Team to investigate further which now may not be until after the Christmas/New Year break.

Changed in firefox (Ubuntu):
status: Incomplete → New
Revision history for this message
Paul Harrison (peharri1) wrote :

This happened again this morning. Before uninstalling the snap, I typed apt policy firefox which reported:

firefox:
  Installed: 1:1snap1-0ubuntu2
  Candidate: 108.0.1+build1-0ubuntu0.22.04.1~mt1
  Version table:
 *** 1:1snap1-0ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status
     108.0.1+build1-0ubuntu0.22.04.1~mt1 1001
       1001 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 Packages

So note, from 'Candidate', it knows it wasn't supposed to install the snap, but did anyway for some reason and the 'snap' version had been installed. After 'snap remove --purge firefox' and 'apt-get remove firefox' followed by 'apt-get install firefox', apt policy firefox is now showing:

firefox:
  Installed: 108.0.1+build1-0ubuntu0.22.04.1~mt1
  Candidate: 108.0.1+build1-0ubuntu0.22.04.1~mt1
  Version table:
     1:1snap1-0ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
 *** 108.0.1+build1-0ubuntu0.22.04.1~mt1 1001
       1001 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status

As far as I'm aware nothing happened this morning (or last night - I'm checking every morning) to cause Firefox to install. I didn't run any updates, Software Updater did not come up.

It feels as if there's a cron job installed in the system somewhere that forcibly installs the snap version, but I have absolutely no clue what that would be because root's is empty, and none of the /etc/cron* scripts appear to be related to this.

Was anything pushed last night that might have triggered this?

Revision history for this message
Paul Harrison (peharri1) wrote :

Happened again today. Again, was anything pushed last night that might have triggered this?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in firefox (Ubuntu):
status: New → Confirmed
Revision history for this message
Gordon Lack (gordon-lack) wrote (last edit ):

I'm having the same problem (on multiple systems).

I've remove'd firefox as a snap nut the snap still gets installed at some later point (when a new one is available?) despite the fact that my apt preferences are set to use the mozillateam-ubuntu-ppa-kinetic PPA.

My preferences file contains this:
==========
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: -10

Package: firefox*
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001

Package: firefox*
Pin: version *snap*
Pin-Priority: -10
==========
Which works, to the extent that as soon as a snap version has been installed the automatic updates indicate that here is an update to be done, to get it back to the non-snap version.

But I want to stop the snap version ever being installed at all (if only because none of my HOMEs are under /home - and never have been - so it doesn't work).

Revision history for this message
Martin Petersen (mp-plusserver) wrote :

I'm having the same problem on my work provided Ubuntu system and this behavior alone would have let me switched OS if I'd be allowed to. I exaggerate a bit :)

I would like to ask You to provide a possibility to disable or exclude firefox as snap for good.

For now I check for the installation type of firefox (snap or deb) and remove snap and the corresponding Ubuntu packages and install the PPA packages again. It was funny for a while but became tiresome quite quickly.

dpkg -l | grep firefox
ii firefox 1:1snap1-0ubuntu2 amd64 Transitional package - firefox -> firefox snap
ii firefox-locale-de 1:1snap1-0ubuntu2 all Transitional package - firefox-locale-de -> firefox snap

sudo snap remove firefox
sudo apt --purge remove firefox firefox-locale-de
sudo apt install firefox firefox-locale-de

I also tried to give priority to the PPA packages as Gordon did and to disable Snap refresh in total because I became annoyed.

sudo snap refresh --hold

I don't want to rip out Snap as a whole b/c it is a work provided device but I am at loss why the installation of small applications like gnome-calculator or ksnip or firefox must be pushed as Snap.

Please try to respect Your users preferences.

Thank You all and kind regards,

Martin

Revision history for this message
mario (ariva78) wrote :

It happen to me to.
I also removed snap as it doesn't support SSO i use in my daily work.
My /etc/apt/preferences.d/mozillateamppa:

Package: firefox*
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 501:

So after each removal, i simply do:
sudo apt remove firefox && sudo apt install firefox, but indeed it's frustrating that we have to do such workarounds.

Revision history for this message
Martin Petersen (mp-plusserver) wrote :

sneaky snap installation of firefox hit me again right now :)

i just want to bump this bug report (pls fix, oh might canonical ! uWu) and report that mario's procedure (sudo apt remove firefox && sudo apt install firefox) works for me, also.

cheers & i y'all a good week

Revision history for this message
herrsaalfeld (herrsaalfeld) wrote (last edit ):

I am having the same problem, but I prevented snap from updating firefox with
```
snap disable firefox
```
Since Ubuntu's transitional deb package does not understand my snap preferences, it now simply *uninstalls* the firefox deb package, and I have to manually update it with
```
sudo apt install firefox
```
after Ubuntu's software updater, kind of silly, and the opposite of user friendly. However, @vanadium offered a solution at

https://askubuntu.com/questions/1407913/how-to-stop-an-individual-snap-from-updating-ubuntu-22-04-lts

that disables Ubuntu's transitional deb package. For me, the combination of setting the priority of the Mozilla PPA and disabling Ubuntu's transitional firefox package looks like this
```
cat <<EOF | sudo tee /etc/apt/preferences.d/mozilla-firefox
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001

Package: firefox*
Pin: release o=Ubuntu*
Pin-Priority: -1
EOF
```

Now, `apt policy firefox` says
```
firefox:
  Installed: 113.0+build1-0ubuntu0.23.04.1~mt1
  Candidate: 113.0+build1-0ubuntu0.23.04.1~mt1
  Version table:
     1:1snap1-0ubuntu3 -1
        500 http://archive.ubuntu.com/ubuntu lunar/main amd64 Packages
 *** 113.0+build1-0ubuntu0.23.04.1~mt1 1001
       1001 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu lunar/main amd64 Packages
        100 /var/lib/dpkg/status
```
and I hope the -1 behind Ubuntu's package will forever block this from happening again.

Revision history for this message
Martin Petersen (mp-plusserver) wrote :

hi fellow ubuntu firefox users,

it happened again and I see no harm in bumping this issue so here we are :)

I already had a pref file for firefox without any real impact as far as I can see. I re-run the command "snap disable firefox" and changed from "Pin-Priority: -10" to "Pin-Priority: -1" as in herrsaalfelds' config but I only have faint hope ;)

anyway: we shall overcome one day, I sure

kind regards to all at canonical and all of you, fellow firefox friends

cheers !

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this issue and helping to make Ubuntu better. Examining the information you have given us, this does not appear to be a bug in the package. We understand the difficulties you are facing, but it is better to raise problems you are having in the support tracker at https://answers.launchpad.net/ubuntu if you are uncertain if they are bugs. If you would prefer live chat support, you can find an IRC support channel for your flavor of Ubuntu here: https://wiki.ubuntu.com/IRC/ChannelList. You can also find help with your problem in the support forum of your local Ubuntu community http://loco.ubuntu.com/ or asking at https://askubuntu.com or https://ubuntuforums.org.

Changed in firefox (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Paul Harrison (peharri1) wrote :

Can you maybe further expand on how this is "does not appear to be a bug" because I cannot fathom any set of circumstances in which "Someone has intentionally removed a program, let's re-install it even though they've explicitly stated they don't want it" is NOT a bug.

This is absurd. How is it not a bug? How? Canonical thinks this is legitimate behavior?

If this is legitimately the position of Canonical right now, I will recommend people switch away from the system as it's no longer possible to predict its behavior upon how it's been configured, and Canonical thinks that's entirely OK.

This is a bug. The ticket needs to be reopened.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Details of why that's not a bug

- Ubuntu decided to default to firefox as a snap and turned the deb to an 'utility' package providing some of the system gluing and installing the snap. The package uses a '1:1snap' version version '1:' is an Debian epoch (which means that version is going to be considered newer than any other version not using it)

- if you remove the snap, it's not being installed back by snapd or the system

- the issue there is that users do install a firefox deb version which is older than the 1:1snap version from the archive. Apt does what is the standard behavior next time you install available updates, it replaces an outdated version by a newer one. The newer version is the archive special package which install the snap, so you get back the snap

The problem there is that people install a deb with a 'buggy' version for what they try to achieve, if you want that deb to stay you need to use a version newer than the archive one. Or to use apt pinning as described in previous comment to hold updates. Or install firefox from the upstream tarball instead of using a deb...

Revision history for this message
Paul Harrison (peharri1) wrote : Re: [Bug 1999308] Re: Snap keeps uninstalling apt Firefox, and reinstalling snap Firefox
Download full text (7.0 KiB)

> if you remove the snap, it's not being installed back by snapd or the
system

This is clearly untrue.

> - the issue there is that users do install a firefox deb version which
is older than the 1:1snap version from the archive. Apt does what is the
standard behavior next time you install available updates, it replaces
an outdated version by a newer one. The newer version is the archive
special package which install the snap, so you get back the snap

If it were the case, then apt-get update / apt-get upgrade (or just the
regular system update tool) would be installing the 1:1snap version. But
that isn't true, the Snap is being reinstalled in the background at an
unpredictable time. apt-get does not "update" the package to the bogus,
removed, package. Indeed, the process for fixing this (minus the lost data)
is apt-get remove firefox followed by apt-get install firefox.

Also the "buggy deb" you're referring to is the one from the official
Mozilla Team PPA, https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/

It sounds as if there's a misunderstanding here of exactly what's going on.
Can this ticket be re-opened please?

On Mon, May 22, 2023 at 8:51 AM Sebastien Bacher <email address hidden>
wrote:

> Details of why that's not a bug
>
> - Ubuntu decided to default to firefox as a snap and turned the deb to
> an 'utility' package providing some of the system gluing and installing
> the snap. The package uses a '1:1snap' version version '1:' is an Debian
> epoch (which means that version is going to be considered newer than any
> other version not using it)
>
> - if you remove the snap, it's not being installed back by snapd or the
> system
>
> - the issue there is that users do install a firefox deb version which
> is older than the 1:1snap version from the archive. Apt does what is the
> standard behavior next time you install available updates, it replaces
> an outdated version by a newer one. The newer version is the archive
> special package which install the snap, so you get back the snap
>
>
> The problem there is that people install a deb with a 'buggy' version for
> what they try to achieve, if you want that deb to stay you need to use a
> version newer than the archive one. Or to use apt pinning as described in
> previous comment to hold updates. Or install firefox from the upstream
> tarball instead of using a deb...
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1999308
>
> Title:
> Snap keeps uninstalling apt Firefox, and reinstalling snap Firefox
>
> Status in firefox package in Ubuntu:
> Invalid
>
> Bug description:
> I have looked on various forums including the search features of
> Launchpad, help.ubuntu..com, and Google for answers on this but not been
> able to.
>
> I have uninstalled the snap of firefox multiple times, installing the
> real
> Firefox from ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/, only for
> a
> few days later (once hours later) for snap to uninstall the real thing
> and
> install its snap version instead.
>
> I have tried a basic
> sudo snap remove firefox
>
> and when that didn't ...

Read more...

Revision history for this message
Paul Harrison (peharri1) wrote :

> Indeed, the process for fixing this

I should stress that by this I mean "the process for temporarily fixing this". The system will still install the unwanted Snap version in the background at a later date.

Revision history for this message
Paul Harrison (peharri1) wrote :

I mean, I literally cut and pasted what apt-get does in my bug report, how the hell did you conclude from that it's not "snapd or the system" and that it's a version number issue from that?

Revision history for this message
Sebastien Bacher (seb128) wrote :

Ok, let's try to figure thing out. Please uninstall the snap, install the deb and next time the snap is installed back please share the output of

1.
$ snap info firefox

2. the corresponding journal log ('-b 0' is the current system log, if you restarted since the snap refresh date from .1 then use '-b -<n>' where <n> is the number of restart since)
$ journalctl -b 0

3.
$ grep firefox /var/log/dpkg.log
(try the .1 variant of the log if there is no mention in the current one)

My guess is that unattended-upgrade or something is replacing your firefox version by the '1:snap' version because is no feature in snapd to 'install firefox automatically'

Revision history for this message
herrsaalfeld (herrsaalfeld) wrote :

If you intercept snap as described above by

   sudo snap disable firefox
   sudo snap remove firefox

and add the Mozilla PPA for Firefox, then the Ubuntu deb package will remove the Mozilla Firefox version without being able to install the snap version because that was disabled. The result is no Firefox. This can be fixed by running apt upgrade twice but I would call this a bug with the package.

This can be prevented by disabling the Ubuntu package by

cat <<EOF | sudo tee /etc/apt/preferences.d/mozilla-firefox
Package: firefox*
Pin: release o=Ubuntu*
Pin-Priority: -1
EOF

but I would have hoped that the package would refrain from deinstalling without replacing. The transitional package must make sure that calling snap will result in the expected package being installed before removing the 'old' version. If that isn't something that can be done with 'transitional' packages in apt, then I would argue that releasing such transitional deb packages should not be done.

Revision history for this message
Sebastien Bacher (seb128) wrote :

There is technical reason why we need the transitional deb. You have options if you are set on not using the firefox version Ubuntu is officially supporting, apt pinning is one. Installing from the upstream tar instead of an official ppa is another one...

Revision history for this message
Paul Harrison (peharri1) wrote :

snap info firefox reports this (currently it isn't installed and shouldn't be):

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: MPL-2.0
description: |
  Firefox is a powerful, extensible web browser with support for modern web application
  technologies.
snap-id: 3wdHCAVyZEmYsCMFDE9qt92UV8rC8Wdk
channels:
  latest/stable: 113.0.2-1 2023-05-23 (2710) 254MB -
  latest/candidate: 113.0.2-1 2023-05-22 (2710) 254MB -
  latest/beta: 114.0b7-1 2023-05-22 (2704) 255MB -
  latest/edge: 115.0a1 2023-05-23 (2711) 261MB -
  esr/stable: 102.11.0esr-2 2023-05-09 (2642) 186MB -
  esr/candidate: 102.11.0esr-2 2023-05-04 (2642) 186MB -
  esr/beta: ↑
  esr/edge: ↑

For the journalctl stuff we're talking about very large files even if I grep them for 'firefox'. I'm not sure how helpful they would be, but see also herrsaalfeld's comments.

At this stage (for the last six months at least) I've actually disabled most of the automatic update tools in one way or another, just running apt-get update/apt-get upgrade manually to avoid these issues.

Also see my posts #2 and #5 above. These show the state of apt before and after each unwanted replacement. Something is forcing the Canonical version, it's not a version number check, it's not normal apt behavior.

Revision history for this message
Paul Harrison (peharri1) wrote :

> I've actually disabled most of the automatic update tools in one way or another

To clarify, yes, this "fixed" it, but obviously "Go and find anything that does updates and cripple it" can't be the solution.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Again, nothing is doing weird things there, the issue is that people install a firefox deb which is older than the one provided by Ubuntu. You can't expect to install older debs and expect them to stick, that's not how apt works and nothing new and not specifics to snaps or firefox

Revision history for this message
Paul Harrison (peharri1) wrote :

> the issue is that people install a firefox deb which is older than the one provided by Ubuntu

Again, this is not true. If it were true, then "apt-get install firefox" after uninstalling the Ubuntu Snap loading version, would REINSTALL THE UBUNTU SNAP LOADING VERSION, not the version from Mozilla.

Please stop asserting this. It's demonstrably false, you've been told multiple times it's false, it doesn't match the bug report, it doesn't match the evidence posted here. It is not true.

Also, again, read #2, and #5.

At what point do I re-open this bug? I've been trying to be patient, but this is getting completely ridiculous.

Revision history for this message
herrsaalfeld (herrsaalfeld) wrote :

The transitional package uses a versioning schema that is incompatible with the Firefox release versioning schema, today:

1:1snap1-0ubuntu3

vs

113.0.2+build1-0ubuntu0.23.04.1~mt1

which makes apt believe that 1:1snap1-0ubuntu3 is a more recent build than 113.0.2+build1-0ubuntu0.23.04.1~mt1 which it typically isn't. The version of the transitional firefox package never changes and does not reflect the version of what version of Firefox snap installs.

@Sebastian, Your statement "the issue is that people install a firefox deb which is older than the one provided by Ubuntu" is therefore obviously false. You may have misunderstood the situation which is completely normal. We all make mistakes all the time. Please recognize this and reopen the bug.

Revision history for this message
Sebastien Bacher (seb128) wrote :

I'm not misunderstanding the situation

$ dpkg --compare-versions 1:1snap1-0ubuntu3 gt 113.0.2+build1-0ubuntu0.23.04.1~mt1; echo $?
0

in the dpkg sense the Ubuntu archive package version is newer than the ppa one due to the epoch, apt is applying the standard logic of replacing a deb package by a newer revision when available, it's the way deb management is working.

I understand the issue your problem, you would like the firefox deb from the ppa to not be replaced by the Ubuntu archive snap installer. For that to work you need to use apt pinning to force the ppa to take precedence over the Ubuntu archive version despite having a lower deb revision, which has been suggested in the bug history.

The other option is to install firefox using the upstream tarball instead of using a deb.

Revision history for this message
herrsaalfeld (herrsaalfeld) wrote :

I understand how deb package management is working, however, 1:1snap1-0ubuntu3 is not a firefox version, the firefox transitional deb package versioning schema is abusing an incompatible version number to override the firefox version regardless what it is. This is a hack to deliberately break what deb package management is doing, not to guarantee that the most recent version of the software is installed but to guarantee that a specific version of the software is pinned, without pinning it. Not cool but a bug.

Revision history for this message
herrsaalfeld (herrsaalfeld) wrote :

@Sebastien You are right, it is perfectly legal to use Debian epochs to override software versions. I haven't seen this much in Ubuntu repositories, so it feels inappropriate, particularly with the software version entirely removed. I guess the Mozilla PPA would have to roll with this versioning schema (add a 1: or 2: prefix) to make things work as expected. What do you feel about the transitional package deinstalling Firefox when the snap package is disabled though? Is that the expected behavior of the transitional package? Both apt and snap do their naively expected job, apt finds a 'newer' version of the package (1:...), removes the 'old' one (103...) and attempts to install the 'new' one and, if disabled, snap does not install it and leaves it disabled. This uninstalls Firefox during apt upgrade which is counterintuitive. Can this be fixed? E.g. by moving all the transitional deb packages into their own silo instead of main? Then, users could just deactivate that silo and the weird interactions between snap and apt would go away.

Anyways, I agree that we have a solution: disable the Ubuntu deb package, remove and disable snap package, bump Mozilla PPA priority, done. The comments about installing from upstream tars are not helpful, because they don't automatically update.

Revision history for this message
Sebastien Bacher (seb128) wrote :

> not to guarantee that the most recent version of the software is installed but to guarantee that a specific version of the software is pinned, without pinning it. Not cool but a bug.

it's more complicated than that. The versioning has been picked to avoid having to re-upload the deb to keep up with versions.

Let's say we would version that deb 108-22.04snap1 today in the LTS serie. Firefox is distributed as a deb in 20.04 and is versioned 108-0ubuntu0.20.04.1. When 109 is out the deb in 20.04 as well as the snap are updated. For upgrades from 20.04 to 22.04 to be possible and work correctly any deb available needs to have a package version number in the newer serie, which means we would to do a stable update to bump the version of the wrapper over the version now available in 20.04.

Those updates would have no real purpose out of catching up with versioning, to creating extra work on the Ubuntu team/SRU reviewers/testers we decided to use an epoch and always have the package newer than the 'old deb' to ensure safe upgrade paths.

Revision history for this message
Sebastien Bacher (seb128) wrote :

> What do you feel about the transitional package deinstalling Firefox when the snap package is disabled though? Is that the expected behavior of the transitional package?

That's not a supported scenario. The Ubuntu team maintains firefox as a snap and the deb has been set up for things to work in the scenario we defined. There isn't really a way we could handle it differently, there is no deb version of firefox supported by Ubuntu we could install if the snap is disabled (the one is the ppa is a best effort from community, it could break or stop being updated, we can't rely on it). If you care enough to go through those manual steps you just have to also do the apt pinning config (or maintain a firefox deb version using an epoch so it's newer than the Ubuntu archive in the apt sense)

Revision history for this message
Paul Harrison (peharri1) wrote :

> in the dpkg sense the Ubuntu archive package version is newer than the ppa one due to the epoch, apt is applying the standard logic of replacing a deb package by a newer revision when available, it's the way deb management is working.

This is not what's happening. I've tried to explain this multiple times, but I assume I'm in a killfile right now or something. apt-get remove firefox ; apt-get install firefox always installs the correct version, not the Canonical snap installer.

Which is what you'd expect, the Mozilla PPA has been given a priority of 1001

$ cat /etc/apt/preferences.d/mozilla-firefox

Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001

$

I'm not going to continue debating this. The insistence that it's a version number thing when I've posted evidence in #2, #5, and multiple times since, that it's not, and when that is never addressed, has made me lose faith in Canonical.

Something somewhere is intentionally, deliberately, overriding apt and forceably removing whatever firefox package is installed and replacing it with the Canonical dev.

If you won't fix it, Ubuntu is garbage.

Revision history for this message
Paul Harrison (peharri1) wrote :

(I've unsubscribed, feel free to remove the bug report, you guys don't care about bug reports anyway. Maybe this explains why snap continues to be completely awful but you're foisting it on everyone anyway.)

Revision history for this message
Renn (renn0) wrote :

I just registered so I can reply to this report because I am incredibly frustrated at having to wrangle the Snap away quite frequently.

To confirm: I am having this exact issue. I've installed Firefox from the PPA and set its priority, and yet it's not being respected by Canonical's package, and the transitional DEB overrides it and then installs the Snap package, at unexpected times when applying updates generally.

I then have to manually uninstall the Snap and then do an "apt reinstall firefox" and then the Firefox PPA overwrites the transitional DEB.

I agree with Paul that this is absurd and there is no way this is the intended behaviour, is it?

If this is intended behaviour, please confirm that the transitional Firefox DEB is *always* expected to take priority and users will never be allowed to permanently override it.

Revision history for this message
Sebastien Bacher (seb128) wrote :

> If this is intended behaviour, please confirm that the transitional Firefox DEB is *always* expected to take priority and users will never be allowed to permanently override it.

No, that's not the intended behaviour. There is no nothing special about the firefox deb nor special handling in apt for it.

Trying a random guess perhaps the pinning as suggested in this bug is not robust? It favors the ppa version over the archive one but if the ppa get disabled for some reason, even temporarily (launchpad having issues which leads to apt failing to download the corresponding index for example), then apt would install back the archive version since then it would be the only candidate and considered as newer than the installed version...

Using `apt-mark hold firefox` would avoid having the package updated even in those cases but then you would need to manually install updates from the ppa...

Revision history for this message
herrsaalfeld (herrsaalfeld) wrote :

Package: firefox*
Pin: release o=Ubuntu*
Pin-Priority: -1

in combination with

snap disable firefox

as described in the above thread is robust for me. Holding firefox disables updates which is not desirable.

Check man apt_preferences for the meaning of priorities:

How APT Interprets Priorities
       Priorities (P) assigned in the APT preferences file must be positive or negative
       integers. They are interpreted as follows (roughly speaking):

       P >= 1000
           causes a version to be installed even if this constitutes a downgrade of the package

       990 <= P < 1000
           causes a version to be installed even if it does not come from the target release,
           unless the installed version is more recent

       500 <= P < 990
           causes a version to be installed unless there is a version available belonging to
           the target release or the installed version is more recent

       100 <= P < 500
           causes a version to be installed unless there is a version available belonging to
           some other distribution or the installed version is more recent

       0 < P < 100
           causes a version to be installed only if there is no installed version of the
           package

       P < 0
           prevents the version from being installed

       P = 0
           has undefined behaviour, do not use it.

Revision history for this message
Renn (renn0) wrote :

> No, that's not the intended behaviour.

Thanks for that. I apologize if I was sounding a bit cynical; I am not very happy with this move to Snap packages for certain applications, and it felt to me like steps were being taken to make it very difficult or impossible to avoid it.

It turns out I may have jumped the gun in any event. I had added these preferences to apt_preferences before, but I think they must have been wiped out during my upgrade to lunar, because when I checked earlier today, they were not set properly.

> Trying a random guess perhaps the pinning as suggested in this bug is not robust?

With a -1 priority, it shouldn't happen, right? Provided the preferences @herrsaalfeld posted above were the ones set? That is how I have it set now.

I cannot disable the firefox snap as suggested above, because I uninstalled it. My hope is that it doesn't return. If it does return, I will try to disable it.

As @herrsaalfeld notes, I don't want to mark Firefox as held, because then it won't get any updates at all.

Thanks for your attention here, all of you.

Revision history for this message
Piotr Henryk Dabrowski (phd) wrote :

This issue is 100% valid and caused by unattended-upgrades:

https://bugs.launchpad.net/ubuntu/+source/unattended-upgrades/+bug/2033646

Workaround:

$ echo -e 'Package: firefox\nPin: release o=Ubuntu\nPin-Priority: 1' | sudo tee /etc/apt/preferences.d/firefox-workaround

Changed in firefox (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

it's not a firefox issue if it's cause by unattended-upgrade closing again

Changed in firefox (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Andrew Conway (acubuntuone) wrote :

The same problem occurs on 24.04, but the workaround of setting the ubuntu priority to a negative number seems to be working.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.