In Ubuntu 22.04 and later Firefox is a Snap package, Ubuntu removed the .deb package for Firefox from it’s repository. If you try to install the deb package via apt, Then it only install the Snap version. In this tutorial we will see how to remove snap Firefox and install deb Firefox back.
How to Uninstall Firefox Snap:
Open the terminal command line application using ctrl+alt+t keys and run below command.
sudo snap remove firefox
And run below command also.
sudo apt remove firefox
These commands will remove Firefox snap and deb package files from your system.
How to Install Firefox Deb on Ubuntu 22.04 & Later
Method1:
In the terminal app run below command to add Firefox Mozilla PPA
sudo add-apt-repository ppa:mozillateam/ppa
Now you need to set a higher PPA priority. In terminal app run this command to create and open empty config file in Gedit text editor.
sudo gedit /etc/apt/preferences.d/mozillateamppa
Now add below lines and save it.
Package: firefox* Pin: release o=LP-PPA-mozillateam Pin-Priority: 501
After saving close it. Now run this command.
sudo apt update
And install the latest version of Firefox web browser as deb in Ubuntu using this command.
sudo apt install firefox
That’s it.
Method2:
First uninstall the Firefox Snap using below command and also remove if you previously add the Mozilla Team PPA to install a Firefox Deb.
sudo snap remove firefox
sudo apt remove firefox
Create an APT keyring if one doesn’t already exist in your system using below command.
sudo install -d -m 0755 /etc/apt/keyrings
After that import the Mozilla APT repo signing key using below command.
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
Now you need to add the Mozilla signing key to your sources.list file using below command.
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
Then set the Firefox package priority to ensure Mozilla’s Deb version is always preferred.
echo ' Package: * Pin: origin packages.mozilla.org Pin-Priority: 1000 ' | sudo tee /etc/apt/preferences.d/mozilla
Now install the latest Firefox in deb using below command.
sudo apt update && sudo apt install firefox
Restore new Firefox Snap:
If you want to go back to the latest Firefox Snap package, then open the Software & Updates tool and under Other Software tab remove the Firefox Mozilla Team PPA.
Now in terminal run below commands. It will install the latest of Firefox Web Browser.
sudo apt update
sudo apt install firefox
Confirm the Firefox snap update notification.
That’s it