7

I am using Ubuntu 24.04 and would like to install Firefox directly from the official Mozilla repository instead of the default Ubuntu Snap/PPA repositories.

  • 3
    Sad that this was marked as a duplicate since none of the answers on that other page is a 1 to 1 match for Ubuntu 24.04. – Alexis Wilke Mar 10 '25 at 15:45
  • And the lead answer of the duplicate is old, because it uses Mozilla's PPA not their APT repository as they now recommend. See support.mozilla.org/en-US/kb/install-firefox-linux. – Andrew Apr 11 '25 at 21:47

1 Answers1

15

To install Firefox from the official Mozilla repository on Ubuntu 24.04, follow these steps:

  1. Install the repository key:

    wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | gpg --dearmor | sudo tee /etc/apt/keyrings/packages.mozilla.org.gpg > /dev/null
    
  2. Create a deb822-formatted .sources file in /etc/apt/sources.list.d/mozilla.sources with the following content:

    Types: deb
    URIs: https://packages.mozilla.org/apt
    Suites: mozilla
    Components: main
    Signed-By: /etc/apt/keyrings/packages.mozilla.org.gpg
    
  3. Set the apt repository priority by creating/editing the file /etc/apt/preferences.d/mozilla with the following content:

    Package: firefox*
    Pin: origin packages.mozilla.org
    Pin-Priority: 1001
    
  4. Allow unattended upgrades for the mozilla repository by creating/editing the file /etc/apt/apt.conf.d/51unattended-upgrades-firefox with the following content:

    Unattended-Upgrade::Origins-Pattern { "archive=mozilla"; };
    
  5. Remove the snap and apt installation of Firefox:

    sudo snap remove firefox
    sudo apt remove firefox
    
  6. Update the package list:

    sudo apt update
    
  7. Install Firefox from the Mozilla repository:

    sudo apt install firefox
    
  8. (Optional) Install additional translations with the packages firefox-l10n-XX where XX is the language identifier (e.g. firefox-l10n-it for Italian).

    sudo apt install firefox-l10n-XX
    

By following these steps, you should have Firefox installed from the official Mozilla repository on your Ubuntu 24.04 system.

  • In my case, the snap firefox comes back (i.e. point 5 sudo snap remove firefox works at the time I run the command, but within a day or so, it's back!). I'm thinking that's a snap thing (not apt-get trying to install firefox). Have you had that issue? – Alexis Wilke Mar 26 '25 at 23:13
  • I will be testing this other preference file on top of yours... That other one is a negative instead of a positive. Maybe it will help. – Alexis Wilke Mar 26 '25 at 23:32
  • The eight steps above worked perfectly in my Ubuntu 24.04. I no longer have the sandboxed firefox from snap which is giving me a headache. I can now open html from other folders outside from $HOME folder, which I needed very badly. Thank you so very much! – daparic May 27 '25 at 11:10