Interested in using the Firefox DEB version on Ubuntu? Let me guide you through it.
If you prefer DEB packages over snap packages, or simply want a different version of Firefox than the default one in Ubuntu 22.04, this tutorial is for you. I’ll walk you through the process of removing the existing Firefox installation and replacing it with the DEB version, step by step.
Let’s jump right in.
What You’ll Need
Before entering the main guide, you should know whether you have everything in place. Here are the requirements:
- Ubuntu 22.04 version installed and running on your system (guide)
- Familiarity with the command line interface and Linux commands (guide)
- Root account or sudo privileges (guide)
- Backup of your current Firefox settings
- A stable internet connection
That being covered, let’s jump right into the first step.
How to Switch to Firefox Deb Installation on Ubuntu 22.04: 5 Steps
Step 1: Verify Your Current Firefox Installation
It’s important to first check which version of Firefox is currently installed on your system.
- Click on the Firefox icon in the left sidebar.
- Click the hamburger menu button in the top right corner.
- Select Help from the menu.
- Click on About Firefox.
- This will display the type of Firefox package you are using. For instance, if it says Mozilla Firefox Snap for Ubuntu, you have the snap package installed.
If your Firefox version matches the snap package, you’re ready to proceed to the next step.
Step 2: Back Up Your Current Firefox Settings
Before removing Firefox, it’s crucial to back up your data, including bookmarks, preferences, and other important information.
- Open Firefox.
- Click the hamburger menu in the top right corner.
- Select Help, then More troubleshooting information.
- In the Application Basics section, find Profile Directory.
- Click on Open Directory. As you can see, the profile directory name is a random 8-character string. In my case, it’s mo1k3o2f.default.
- Right now, you’re inside the profile directory. However, you want to be one level upper in the directory structure. To do that, press on firefox in the directory structure.
- Right-click on your profile directory and select Copy, or use Ctrl+C.
- Paste the copied directory to a secure location, ideally an external drive.
With this backup, you’ll be able to restore your Firefox settings later.
Step 3: Uninstall Firefox Snap from Ubuntu
Now that you’ve backed up your settings, let’s remove Firefox Snap from your system.
- To uninstall Firefox Snap from your system, run the following command:
sudo snap remove firefox
- After removing the Snap version, uninstall the empty DEB package with:
sudo apt remove firefox
With the snap version of Firefox successfully uninstalled, you’re ready to install the Firefox DEB version.
Step 4: Install the Firefox DEB Package on Ubuntu 22.04
We will now install the Firefox DEB package. Direct installation via APT might revert to the snap version, so we’ll use a PPA (Personal Package Archive) for a workaround.
- Run this command to include the PPA in your system:
sudo add-apt-repository ppa:mozillateam/ppa
- Press Enter when prompted to confirm.
- To ensure APT selects the DEB package from the PPA instead of the default snap package, adjust the priority by creating a configuration file (I’ll be using the Nano text editor):
sudo nano /etc/apt/preferences.d/firefoxdeb
Note: You can feel free to use a different name than firefoxdeb.
- Insert the following configuration:
Pin: release o=LP-PPA-mozillateam
- Save with Ctrl+O, and exit Nano with Ctrl+X.
- Apply the changes by updating the cache:
sudo apt update
- Lastly, install Firefox DEB with this command:
sudo apt install firefox
- In case you want the ESR version of Firefox, run this command:
sudo apt install firefox-esr
- To confirm the installation, follow the steps in Step 1 of this guide to check the package version of Firefox. If everything went well, you should see the below output:
A successful installation will display the correct version. Following these steps ensures the installation of the Firefox DEB version on Ubuntu 22.04.
Step 5: Restore the Backup From the Snap Version
Now that the DEB version of Firefox is installed, you can restore your settings from the previous version.
- Open Firefox and click the hamburger menu in the top right corner.
- Navigate to Help > More troubleshooting information.
- Under Application Basics, find Profile Directory. Note the name of the profile, which is an 8-character string. In my case, it’s 7574kg5e.default-release.
- Close Firefox.
- Go to the backup location of your previous profile settings.
- Rename the backup directory to match the new profile directory name. In my case, I’ll rename mo1k3o2f.default to 7574kg5e.default-release.
- Transfer the renamed profile folder to /home/<your-username>/.mozilla/firefox replacing <your_username> with your actual username. This is where Firefox stores profile data.
- Restart Firefox to check if the backup has been restored successfully.
How to Switch Back to the Ubuntu Snap Version of Firefox
If you decide to revert to the snap version of Firefox, follow these steps:
- Remove the PPA from the system with this command:
sudo add-apt-repository -r ppa:mozillateam/ppa
- Press Enter to confirm the removal.
- Next, use the following command to remove the file you previously created:
sudo rm -rf /etc/apt/preferences.d/mozilla-firefox
Note: Replace mozilla-firefox with the actual name of your configuration file.
- Remove the Firefox DEB package:
sudo apt remove firefox
- Lastly, install the snap version with:
sudo snap install firefox
After completing these steps, the snap version of Firefox will be reinstalled and ready to use.
Well done! You should now have the Firefox DEB version installed on your computer. This guide has covered how to transfer your settings and preferences between versions. Additionally, I’ve provided instructions for reverting to the snap version if needed. If you’re interested in more Firefox tutorials, check out how to install an older version of Firefox on Linux Mint.
If this guide helped you, please share it.