The official Ubuntuzilla instructions use apt-key to import the key, which while it will still work, will generate nasty-grams as it's deprecated and will eventually go away. So here's a script I wrote to install Firefox that uses gpg to import the key from the keyserver, but then export it to a dearmored gpg file and store it like apt wants nowadays. It also will create an /etc/apt/preferences.d/ file to prevent the Ubuntu snap package from installing. I'm not GREAT with keys, so what I'm doing in multiple steps very well may be able to be done in a single step, but it's a functional base to start with if it's something you want to do. It requires bash instead of sh due to using the echo -e option, it can be done in multiple lines if you'd prefer to use sh for it.
Code: Select all
#!/bin/bash
echo "deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" > /etc/apt/sources.list.d/ubuntuzilla.list
gpg --keyserver keyserver.ubuntu.com --recv B7B9C16F2667CA5C
gpg --export --armor B7B9C16F2667CA5C > /etc/apt/trusted.gpg.d/ubuntuzilla.asc
gpg --dearmor /etc/apt/trusted.gpg.d/ubuntuzilla.asc
rm /etc/apt/trusted.gpg.d/ubuntuzilla.asc
echo -e "Package: firefox \nPin: release o=ubuntu \nPin-Priority: -10" > /etc/apt/preferences.d/firefox
apt update
apt install firefox-mozilla-build