Install Firefox as a deb on Ubuntu 22.04
Introduction¶
Ubuntu 22.04 removes a native Firefox package in favor of a snap package. I'm sure this has advantages.
But the reality for me was several fold: startup times were noticeably slower, and the selenium geckodriver just plain didn't work for me (issue here), with some debate online but no canonical solution. I also couldn't get Jupyterlab to autolaunch (minor, but annoying).
Solution below reproduced from https://balintreczey.hu/blog/firefox-on-ubuntu-22-04-from-deb-not-from-snap/ with adaptations which worked for me.
Solution¶
You can still install Firefox as a native deb
from the Mozilla team PPA. The process which worked for me was:
Step 1¶
Add the (Ubuntu) Mozilla team PPA to your list of software sources by running the following command in the same Terminal window:
sudo add-apt-repository ppa:mozillateam/ppa
Step 2¶
Pin the Firefox package
echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox
Step 3¶
Ensure upgrades will work automatically
echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox
Step 4¶
Install firefox (this will warn of a downgade - ignore it)
sudo apt install firefox
Step 5¶
Remove the Firefox snap
sudo snap remove firefox
Conclusion¶
This worked for me - Firefox starts, my existing Selenium scripts work.