Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Install Firefox From APT Repository


I just installed the minimal version of Kubuntu 24.04 which doesn't come with Firefox. When I try to install Firefox, it tries to install it through snaps by default. This tutorial will show you how to run a script so that you configure installing from Firefox's repository with traditional debian packages.


Copy, paste, and run the BASH script below to configure an APT source for Firefox and prefer that, so we don't install Firefox using snaps.


# instructions to install firefox from:

sudo install -d -m 0755 /etc/apt/keyrings

wget -q -O- | sudo tee /etc/apt/keyrings/ > /dev/null

gpg -n -q --import --import-options import-show /etc/apt/keyrings/ | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}'

echo "deb [signed-by=/etc/apt/keyrings/] mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null

# Configure APT to prefer from the repo
echo '
Package: *
Pin: origin
Pin-Priority: 1000
' | sudo tee /etc/apt/preferences.d/mozilla

# Finally, install Firefox
sudo apt-get update \
  && sudo apt-get install firefox -y
Last updated: 1st May 2024
First published: 1st May 2024