Never use snap firefox
#!/bin/bash
if [[ $(id -u) == 0 ]]
then
snap remove firefox
add-apt-repository ppa:mozillateam/ppa
cat > /etc/apt/preferences.d/mozilla-firefox << EOF
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
Package: firefox*
Pin: release o=Ubuntu
Pin-Priority: -1
EOF
apt update
apt install -y firefox
else
echo 'Please run this script as root.'
fi