45

As far as I see in the ongoing development for 22.04 Jammy, Firefox is a Snap package. The related Deb package in apt is just a shortcut/link to the that snap version.

I prefer my installation not to be from snap packages, since I find them too much 'Ubuntu-specific'.

Are there alternative ways to install Firefox on Jammy?
My favourite option would be an Apt repository or PPA. I will test the Flatpak version with my test virtual machine in the meantime.

Thanks!

2
  • For users of 16.04 ESM, only the snap firefox package is supported now; but a number of deb packages are supported/upgraded only via snap packages for ESM - wiki.ubuntu.com/SecurityTeam/ESM/16.04
    – guiverc
    Mar 26 at 21:53
  • 1
    The Firefox snap is published by upstream Mozilla, and it's intended for ALL Linux distros. Mozilla chose the snap precisely because it's the opposite of "Ubuntu-specific." Ubuntu, for several reasons, has merely embraced snaps earlier than other distros.
    – user535733
    Apr 30 at 17:07

5 Answers 5

44

The other answer by Organic Marble is for Firefox-ESR, and the answer by eddygeek is for the beta version.

This answer is for the latest stable version of Firefox. You can use the Firefox PPA maintained by Mozilla team.

sudo add-apt-repository ppa:mozillateam/ppa

Then, copy and paste the following code in a terminal in one go (don't copy-paste line by line) to prioritize the apt version of firefox with the snap version.

echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox

Next, remove the snap version of firefox

sudo snap remove firefox

Install Firefox with apt.

sudo apt install firefox

To ensure that unattended upgrades do not reinstall the snap version of Firefox, enter the following command. Alternatively, you can turn off unattended upgrades.

echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox

To undo these changes

  1. Remove the firefox PPA.
sudo add-apt-repository -r ppa:mozillateam/ppa
  1. Remove the apt pin.
sudo rm -rf /etc/apt/preferences.d/mozilla-firefox
  1. Remove the apt version and reinstall snap.
sudo apt remove firefox && sudo snap install firefox

Source: OMG Ubuntu

6
  • 5
    Unattended upgrades may reinstall the snap version if unconfigured. See here
    – mook765
    May 1 at 16:53
  • 8
    It is stupid that Ubuntu thinks that the version in snap is newer than the one from the actual repository. This answer makes sense to block Ubuntu from installing the snap version but it really seems like a pain that you have to add the pinning to block it now where in the past you did not. Thanks for a great answer! +1
    – Terrance
    May 1 at 17:33
  • 2
    An unattended upgrade recently reinstalled the snap version for me, so it seems the step to add the 51unattended-upgrades-firefox file, that @mook765 recommended, is important.
    – Enterprise
    May 18 at 2:26
  • 1
    @RandyCragun I have added instructions for undoing the changes. If you have any questions about the steps, you can ask them. Jun 16 at 2:29
  • 1
    These instructions seem to turn off unattended upgrades for basically all packages, not just firefox. seeing: e.g. 2022-08-05 06:09:28,284 INFO Package xserver-xorg-video-nvidia-510 is kept back because a related package is kept back or due to local apt_preferences(5). 2022-08-05 07:32:35,547 INFO Starting unattended upgrades script 2022-08-05 07:32:35,547 INFO Allowed origins are: o=Ubuntu,a=jammy, o=Ubuntu,a=jammy-security, o=UbuntuESMApps,a=jammy-apps-security, o=UbuntuESM,a=jammy-infra-security, o=LP-PPA-mozillateam,a=jammy Aug 6 at 3:11
5

The transition of Firefox from Deb to Snap was announced in September 2021. See https://discourse.ubuntu.com/t/feature-freeze-exception-seeding-the-official-firefox-snap-in-ubuntu-desktop/24210/199 for complete discussion.

This is the result of cooperation and collaboration between the Desktop and Snap teams at Canonical and Mozilla developers, and is the first step towards a deb-to-snap transition that will take place during the 22.04 development cycle.

Translation: The shift of Firefox from Deb to Snap is a Mozilla-driven decision. The Ubuntu teams are trying to make the transition as painless as possible for most folks.

A lot of volunteers have been testing the Firefox Snap, discovering/filing/fixing bugs for the entire 21.10 cycle to sand down the rough edges and document the corner-cases. (It's been my daily driver for five months)

When the transition is complete, you will have four options:

  1. Use the Snap. The Snap comes from Mozilla upstream, and is designed to be cross-distro and cross-platform. You should not find it "Ubuntu-specific." The Firefox Snap will be included in stock installs of Ubuntu Desktop.

  2. Download the binary from Mozilla upstream. This requires knowledge of how to install and uninstall without a package manager. It's the same binary used in the Snap.

  3. If you still want to use deb packages that are in the Ubuntu Repositories, then join Debian and help the volunteer packagers who work Firefox. It's a complex beast to packages as a deb (which is why Mozilla is unenthusiatic about continuing the effort) but the community --with enough volunteers-- is capable of great things.

  4. The Ubuntu Mozillateam PPA currently offers Firefox-beta and Firefox-ESR deb packages. These are generally high-quality packages, and also depend upon enough volunteer participation to maintain that quality.

  5. Flatpak and other add-on package managers.

6
  • 5
    Both Flatpak or Snap have the same problem. Both are methods of packaging something "non-native" to the system that brings a lot of environment/dependencies/etc. with it. While for some "standalone" applications this is OK, such an important piece of system as a default web browser should be closely integrated with the system, which means it should be a .deb package. Use of Debian .deb package seems to be the only viable way.
    – raj
    Mar 26 at 15:23
  • 2
    @raj well, it's not going to be a .deb package anymore, like it or not, without a lot more volunteer participation.
    – user535733
    Mar 26 at 18:02
  • 4
    The Mozilla Team PPA has already made the package (along with ESR & thunderbird). The maintainer of Ubuntu's own Firefox package is the team member. launchpad.net/~mozillateam/+archive/ubuntu/ppa. And there's a step by step guide to add the PPA and set priority.
    – Nim
    Apr 5 at 15:43
  • 3
    This bug bugzilla.mozilla.org/show_bug.cgi?id=1661935 (Snap does not support NativeMessaging) makes the snap version too limited for now (eg. browserpass extension, kde plasma integration, gnome extensions integration, etc...). It is a real regression, and I'm not sure the proposed solution will be ready soon...
    – alci
    Apr 6 at 8:06
  • 2
    So what exactly happens if you've deliberately purged the firefox snap from 21.10 and installed the non-snap version? Is it going to dishonor your purge and install the snap anyway, or not install Firefox at all?
    – Michael
    Apr 22 at 18:13
2

You can install the official Firefox ESR (Extended Support Release) version via .deb from the Mozilla ppa

sudo add-apt-repository ppa:mozillateam/ppa
sudo apt install firefox-esr

More information is available here: https://ubuntuhandbook.org/index.php/2022/03/install-firefox-esr-ubuntu/

1

You can install the latest official .deb builds working with Ubuntu 22.04 LTS (Jammy) here:
https://launchpad.net/~phd/+archive/ubuntu/firefox/

This is a PPA repository with official Ubuntu packages released originally for Ubuntu 20.04 LTS (Focal) and updated automatically as soon as a new version is released.

1

I found the following workaround to get a deb-based firefox from the firefox-next ppa.

Warning: It is the beta version!

Because the package name is also firefox, we need to blacklist the dummy snap shortcut package which has version 1:1snap1-0ubuntu2

sudo apt remove firefox
echo "
Package: firefox
Pin: version 1:1snap1-0ubuntu2
Pin-Priority: 99
" | sudo tee /etc/apt/preferences
sudo add-apt-repository ppa:mozillateam/firefox-next
sudo apt install firefox

Here is a variant of the add-apt-repository step, that still respects the new package signing requirements - it works with both ppa (main release) and firefox-next (beta) repositories:

sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --no-default-keyring --keyring /usr/share/keyrings/firefox.gpg --recv-keys 9BDB3D89CE49EC21
echo 'deb [signed-by=/usr/share/keyrings/firefox.gpg]  https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy main 
' | sudo tee /etc/apt/sources.list.d/firefox.list

(This was useful for me because under pre-release of KDE Neon 22.04, add-apt-repository currently returns aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Neon/jammy)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.