As anyone using Ubuntu 22.04LTSFirefox must have noticed, the Snap install crashes frequently, effectively destroying the Firefox installation entirely. The current recommended work-around to the issue is to install Firefox from the Mozilla repository instead of Snap. In this blog I’ll tell you how I did it.
Script:
The script should explain itself. It starts with disabling the broken Snap and removing it completely. Then the Mozilla repo is added. From there on it installs a Firefox ESR. The remainder of the script are a fancy exit before notes of addons I like to use. The addons are in notes because Firefox doesn’t allow scripting addons. They need to be added manually.
You can download the script here and run it after chmod +x as is.
If you would like another version of Firefox, just follow the instructions in the script. Likely you’ll have to change the version eventually, as the versions in the repo update frequently.