Score:1

(K)ubuntu keeps replacing Firefox form the PPA with Firefox Snap on system updates

rw flag

I'm using a custom Firefox setup using the Mozilla Team PPA (following more or less this guide, but not using the unattended update configuration) on Kubuntu 22.04. I also use firejail to run Firefox on my system, which is one of the reasons why I want to avoid Snap.

Before installing Firefox from the PPA I also disabled and removed the Firefox Snap:

sudo snap disable firefox
sudo snap remove firefox

With the higher priority of the PPA over Snap, the apt policy usually looks like:

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

However, when updating my system (sudo apt update && sudo apt upgrade && sudo apt full-upgrade), the Firefox Snap version is regularly installed again and overwrites the PPA Firefox, even showing this in the apt policy after the update:

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

I temporarily resolve this manually by removing and installing Firefox via apt again, which will install Firefox from the PPA again.

sudo apt remove firefox
sudo apt install firefox

I use other Snap applications on my system, so removing Snap is unfortunately not an option at the moment.

How do I prevent Snap from overwriting my Firefox PPA install?

EDIT: The post here on AskUbuntu suggests, this can be prevented by adding the PPA to the unattended update list. If at all possible I want to avoid unattended updates of Firefox, because this kills my workflow for every update. Is there any other approach?

guiverc avatar
cn flag
Many Ubuntu *devs* have blogged about it; eg. https://balintreczey.hu/blog/firefox-on-ubuntu-22-04-from-deb-not-from-snap/ which appeared long ago on Planet Ubuntu.. You'll note in the provided link that the *dev* deals with that too.
GarlicCheese avatar
rw flag
@guiverc I don't quite see where this discusses the issue of Snap overwriting the PPA Firefox.
GarlicCheese avatar
rw flag
@mook765 From the discussion there, I added the negative priority for the Snap apt preferences. Now I'll have to wait and see if that helps.
mook765 avatar
cn flag
@GarlicCheese Read the linked answer carefully, you also have to prevent unaatended upgrades from doing so, see the line `echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox`.
GarlicCheese avatar
rw flag
@mook765 thanks for the hint! Unattended upgrades are very interruptive to my workflow and I shudder every time I see the `Restart Firefox` screen. Any other viable approach?
mook765 avatar
cn flag
[This](https://askubuntu.com/q/18654/590937) might be helpful. It seems also possible to blacklist certain packages from unattended upgrades via `/etc/apt/apt.conf.d/50unattended-upgrades`, look for the section `Unattended-Upgrade::Package-Blacklist {` and add firefox here. I've never done this so far, but I think it's worth a try. Of course, you'd have to upgrade firefox manually then, be aware of a security risk due to late upgrades.
GarlicCheese avatar
rw flag
@mook765 thanks for that link! I'll try this approach and see how the behavior with snap changes. I'll report back once I have some results. Thank you also for the hint about the security risk. I'm fully aware of this and frequently, manually update my systems.
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.