How to install Firefox as a traditional deb package (without snap) in Ubuntu 22.04 or later versions?

This answer is for the latest stable version of Firefox. You can use the Firefox PPA maintained by Mozilla team.

sudo add-apt-repository ppa:mozillateam/ppa

Then, copy and paste the following code in a terminal in one go (don’t copy-paste line by line) to prioritize the apt version of firefox over the snap version.

echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001

Package: firefox
Pin: version 1:1snap1-0ubuntu2
Pin-Priority: -1
' | sudo tee /etc/apt/preferences.d/mozilla-firefox

Next, remove the snap version of firefox

sudo snap remove firefox

Install Firefox with apt.

sudo apt install firefox

To ensure that unattended upgrades do not reinstall the snap version of Firefox, enter the following command. Alternatively, you can turn off unattended upgrades.

echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox

To undo these changes

  1. Remove the firefox PPA.
sudo add-apt-repository -r ppa:mozillateam/ppa
  1. Remove the apt pin.
sudo rm -rf /etc/apt/preferences.d/mozilla-firefox
  1. Remove the apt version and reinstall snap.
sudo apt remove firefox && sudo snap install firefox

Source: software installation – How to install Firefox as a traditional deb package (without snap) in Ubuntu 22.04 or later versions? – Ask Ubuntu