How to Install Firefox as classic Deb in Ubuntu 22.04 & 24.04

Last updated: September 5, 2024 — 37 Comments

Ubuntu 22.04 finally removed the .deb package for Firefox web browser from it’s repository! Here’s how to install it back.

As you may know, Firefox in Ubuntu repository since 22.04 is a Snap package that runs in sandbox. It’s easy to remove it. But when you try installing the deb package via apt, it just install the Snap version back!!

Like Chromium, the Firefox deb in Ubuntu 22.04 + repository is an empty package that links to the Mozilla’s official Snap.

And, if you want to install the latest Firefox using the classic .deb package format, there are 2 easy ways:

  • Mozilla Team PPA maintained by Ubuntu Team members.
  • Mozilla’s new apt repository maintained by Firefox developer team!

(Optional) Remove the pre-installed Firefox Snap

It’s OK to keep the default Snap package. But it will cause duplicated Firefox icons after installing Firefox in .deb package format.

NOTE: Export bookmarks and backup other important data before removing it!

To remove it, press Ctrl+Alt+T on keyboard to open terminal. Then, run the command:

sudo snap remove firefox

Also, remove the empty Deb package by running command:

sudo apt remove firefox

Option 1: Install Firefox via “Mozilla Team” team PPA

The team described that it has assumed responsibility for Ubuntu’s official Firefox and Thunderbird packages.

And, the Firefox and Firefox ESR package maintainer for “Mozilla Team” team PPA, Rico Tzschichholz, is a well-known Ubuntu user who also maintains the official packages for LibreOffice, Plank dock, and unbound DNS server.

1. Add Mozilla Team PPA

In terminal (Ctrl+Alt+T), run the command below to add the PPA. Type user password (no asterisk feedback) when it asks and hit Enter to continue.

sudo add-apt-repository ppa:mozillateam/ppa

As the PPA description indicates, the PPA was previously created for Firefox ESR and Thunderbird. It now contains the latest Firefox too.

2. Set PPA priority:

The empty Firefox deb in Ubuntu’s official repository has version number 1:1snap1-0ubuntu2. It’s always higher than the PPA package version. Running package updates either via sudo apt upgrade or ‘Software Updater’ will automatically install the official one which redirects to Snap.

To workaround the issue, you have to set a higher PPA priority. To do so, run the command below in terminal (Ctrl+Alt+T):

sudo gedit /etc/apt/preferences.d/mozillateamppa

For Ubuntu 24.04, replace gedit in command with gnome-text-editor, or use nano that works in all the desktop environments.

The command creates and opens empty config file in Gedit text editor. When it opens, add the lines below and save it:

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

For nano text editor, press ctrl+s to save file, and ctrl+x to exit.

After saving the file, run sudo apt update command in terminal to apply changes.

sudo apt update

3. Install Firefox via apt

Tip: the commands in this step also installs Firefox for the old Ubuntu 16.04. Though sudo apt update need to be run first.

Finally, run the command below to install the latest Firefox package as deb:

sudo apt install firefox

Here -t 'o=LP-PPA-mozillateam' specifies to install Firefox from that PPA. It’s required until you set higher PPA package priority (see next step).

The -t 'o=LP-PPA-mozillateam' flag is no longer required after setup PPA priority.

For choice, you may install Firefox ESR instead. It’s another official Firefox package that moves slowly and targets for school or enterprise use.

sudo apt install firefox-esr

Option 2: Install Firefox via its official repository

Mozilla’s new apt repository contains 4 versions of Firefox packages: Firefox Stable, Firefox Beta, Firefox Development Edition, and Firefox Nightly. It’s a good choice for Ubuntu & Debian users.

1: Get Repository Key file

To add the new repository, you need to first download & install the key, so your system will trust the packages from it.

First, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to make sure ‘/etc/apt/keyrings’ exist for storing the keys.

sudo mkdir -p /etc/apt/keyrings

Then, download & install the key by running the single command below in terminal:

wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null

After that, you can verify the new key file by listing the content of that directory via command ls /etc/apt/keyrings.

2: Add Mozilla’s apt repository

Also in a terminal window, run the single command below will create a config file and write the source repository.

echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee /etc/apt/sources.list.d/mozilla.list > /dev/null

When done, you may verify by running cat /etc/apt/sources.list.d/mozilla.list to print the source file content.

3. Set apt repository priority:

Also you need to set higher priority for Mozilla’s repository, so Ubuntu will install Firefox from it rather than the snap package.

To do so, run command to create & edit the config file:

sudo gedit /etc/apt/preferences.d/mozilla

Also, replace gedit with gnome-text-editor for Ubuntu 24.04, or use nano command line editor that works in most desktop environments.

When file opens, add following lines and save it (For nano, press ctrl+s to save, and ctrl+x to exit).

Package: firefox*
Pin: origin packages.mozilla.org
Pin-Priority: 1001

4. Install Firefox:

Finally, refresh your system package cache by running command in terminal:

sudo apt update

And, install Firefox from that repository via command:

sudo apt install firefox

You may also use firefox-beta, firefox-devedition, or firefox-nightly in last command to install other versions.

How to Restore Firefox Snap:

To restore the pre-installed Snap package, or uninstall the .deb package, first remove the repositories:

  • To remove the Mozilla Team PPA, launch ‘Software & Updates‘ utility and navigate to Other Software tab, finally remove the corresponding source line.
  • To remove the Mozilla apt repository, simply delete the source file, by running command in terminal:
    sudo rm /etc/apt/sources.list.d/mozilla.list

After that, either launch Software Updater to upgrade Firefox or use apt commands below. Both of which will automatically install back the pre-installed Snap package.

sudo apt update
sudo apt install firefox

That’s all. Enjoy!

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: Buymeacoffee | https://ko-fi.com/ubuntuhandbook1 |

37 responses to How to Install Firefox as classic Deb in Ubuntu 22.04 & 24.04

  1. What about bookmarks and passwords, where are they?

  2. “…but it lacks desktop shortcut integration.” can be solved using:

    sudo wget https://raw.githubusercontent.com/mozilla/sumo-kb/main/install-firefox-linux/firefox.desktop -P /usr/local/share/applications

    and Firefox will automatically update very fast, when enabled in preferences.
    This can be verified in –> Help –> about Firefox

  3. Great post :D Thanks a lot for help. Someone should hang the guy responsible for removing firefox deb from ubuntu. SSO Doesn’t work in snap mode.

  4. AFAIK, ‘zilla-bsed browsers – with the exception of LibreWolf – always update ‘in-situ’. All they do is to re-write the contents of the ‘firefox’ directory.

    At least, that’s how it’s always worked for me…

  5. the state of things April 10, 2022 at 10:06 am

    The ‘cost’ of using Ubuntu is constantly rising. It’s high time to reconsider using something else. There are better distributions out there with better native packaging, less bloat and more up to date.

    • suggestions? After continuous desktop use since Ubuntu 8, I’ve reached the end of my patience. Also the blue air constantly around me makes it hard to see.

      I used to have > 100 ubuntu desktops spread over 5 clients. The upkeep has made windows 10 a better option for all of these clients.

  6. I have used the Ubuntuzilla repository for Firefox, Firefox ESR, Seamonkey and Thunderbird for years and been highly satisfied with there versions. There were versions of standard Thunderbird Gmail told me were not secure and would not let me use for my gmail account, but the Ubuntuzilla version never had that problem

  7. John Lauterbach April 15, 2022 at 4:18 pm

    Your suggestion was total waste of time. The Firefox PPA you recommended wouldn’t work, It timed out even with very fast internet connection. Moreover, it killed all my history on reinstalling Firefox even with syncing

  8. So if the Ubuntu Firefox team is building and maintaining Firefox for the PPA, how is it saving Canonical any work to package the thing as a Snap? The whole idea of the Snap for Chromium and Firefox was supposed to be to reduce the burden on Canonical… but now instead of building it just as a .deb for each version, they are building it as a .deb, maintaining a separate PPA, building it as a Snap, and maintaining it as a Snap. That’s less work, I guess??

  9. so, how to connect gnome extentions in firefox snap?!

    • Firefox snap just don’t support this feature so far due to sandbox permission issue. Just wait or switch to another package.

  10. Thanks for the instructions.

    We can set the PPA before installing Firefox with: sudo apt install firefox

    No need to add: -t ‘o=LP-PPA-mozillateam’

    • My wrong, should be:

      We can set the PPA *priority* before installing Firefox with: sudo apt install firefox

      So, the steps would be:

      1. Remove Firefox Snap
      2. Add Mozilla Team PPA
      3. Set PPA priority
      4. Install Firefox via apt (without -t ‘o=LP-PPA-mozillateam’)

      • Hello,
        I did exactly that on the latest Ubuntu Mate 22.04 but I can’t find the shortcut of the new Firefox deb, do you know where I can find it? Can’t launch the app.

  11. Rasmus Skramstad April 22, 2022 at 10:41 am

    If you use the force flag -f for installation sudo apt install -f -t 'o=LP-PPA-mozillateam' firefox you can install firefox and keep the old data from the snap. After the new firefox deb package is installed you can remove the snap, be sure to open the new deb firefox before you remove the snap to import your settings/data.

    • Thanks for the tip, but it seems not importing bookmarks automatically. I’m running a fresh Ubuntu system, there’s no enough browsing data to try out other change.

  12. You can download latest official .deb build for 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.

  13. This seems to be an old version you get. I think it’s time to evaluate a new browser. Thanks Mozilla for a good browser over the past years.

  14. I followed these directions and the “apt install…” actually just installs the snap, so this is a complete waste of time.

  15. “The Linux tarball is a good choice, but it lacks desktop shortcut integration. And you have to manually download the latest package every time a new release is out!”

    Bullshit. Mozilla’s tarball comes with autoupdate feature which will download patch and update Firefox to latest version. NOT in background, no, but while Firefox running. And its dont interrupt you to restart, update wil be applied when YOU feel like it.

  16. In step 1 you still need to do ‘sudo apt remove firefox’ also, or you can’t install it, because it tells you:

    $ sudo apt install -t 'o=LP-PPA-mozillateam' firefox
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    firefox is already the newest version (1:1snap1-0ubuntu2).
    0 to upgrade, 0 to newly install, 0 to remove and 83 not to upgrade.

  17. I installed the mozilla build version after removing the snap version.
    I did it because the snap version behaved poorly and didn’t work with my preferred apps.
    BUT
    the Mozilla build had a new issue. The icon goes exactly where it is supposed to the top of the column on the right side of the screen but when I click it it opens another icon at the bottom of that column and is can not be relocated. If I grab it with the mouse and try to relocate it it just goes back to the bottom when I release it.

  18. Excellent tutorial! Thanks for the work

  19. Couldn’t launch firefox on x11 server. This one finally helped me so thanks.

  20. thanx.
    In addition to making a backup you can also migrate the profile folder.
    Regarding profile folder it should be in ~/snap/firefox/common/
    You can copy that to the proper location ~/.mozilla/firefox/.
    Note that firefox should not be running.
    In the new installtion you can select profiles via firefox -P.

  21. A big “thank you’ for the solution for Mozilla in deb , since two day
    my brain was atomised in the terminal to find a solution :) , i’m a beginner with Linux.Today,
    with the help on your website, in just
    fifteen minutes : it’s ok.
    Have a good day!

  22. These instructions worked perfectly for me initially.

    But after a few weeks, a standard “apt upgrade” did replace the firefox deb from the ppa by the snap package.

    I found other instructions that used “Pin-Priority: 1001” instead of “Pin-Priority: 501”. (https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04)

    I did that and I have had no further problems.

  23. Mozillateam PPA has now switched to producing a snap. So they broke this and it no longer works.

    • Members of Mozillateam PPA are mostly the guys from Ubuntu Team, so, why they create PPA to re-produce Firefox Snap that’s already in system repository ??

      The PPA does still provide the .deb package for Firefox. However, you have to remove the Firefox Deb package (sudo apt remove firefox) from system repository, which is a wrapper to Snap. Then, setup higher PPA priority (501 worked for me, though someone reported 1001 is required).

  24. Hey, you’re great! Your instructions clear, brief, but they work. Really appreciate your work.

  25. Good answer.

  26. after trying so many suggestions which failed, this one worked for me. thanks guys. good work.

  27. I found my operating system’s version of Firefox was significantly behind Mozilla’s latest version.

    I followed Mozilla’s guide:
    https://support.mozilla.org/en-US/kb/install-firefox-linux#w_install-firefox-deb-package-for-debian-based-distributions

    But, I found automatic OS updates were reinstalling the older version of Firefox.

    I ran:
    cat /etc/apt/preferences.d/*

    to list all files in the preferences directory. I found the OS repositories were set to priority 1001.

    After setting the Mozilla repository to priority 1002, it’s now using the Mozilla repository.

  28. The simplest way is to install firefox-esr which is not a snap.

  29. Hi Ji
    When I followed your Thunderbird .deb instructions, all went smoothly. Thanks. But when I did the same on Firefox – this page – it reinstalled Snap. I did it twice. Then compared with OMGUbuntu instructions – I had not earlier because the title said 22.04, not 24.04. But it worked.
    Upon looking at both, it appears the 2nd half of the lines are missing above. I’m not technical but it seems to be a priority thing. And you had it for the Thunderbird instructions. So I tried using this, and it installed the .deb. So obviously it is needed.
    echo ‘
    Package: *
    Pin: origin packages.mozilla.org
    Pin-Priority: 1000

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

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

*