1

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?

  • 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. – guiverc May 24 '23 at 05:41
  • @guiverc I don't quite see where this discusses the issue of Snap overwriting the PPA Firefox. – GarlicCheese May 24 '23 at 05:50
  • @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. – GarlicCheese May 24 '23 at 05:50
  • 1
    @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. – mook765 May 24 '23 at 05:53
  • @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? – GarlicCheese May 24 '23 at 06:16
  • 1
    This 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. – mook765 May 24 '23 at 07:35
  • @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. – GarlicCheese May 24 '23 at 07:43

0 Answers0