File firefox-deb-install of Package kimi-utils-ubuntu

#!/usr/bin/bash

sudo snap remove --purge firefox
sudo apt-get -y remove firefox

#FILE=/etc/apt/preferences.d/mozilla-firefox
#cat <<EOF | sudo tee $FILE	
#Package: firefox* thunderbird*
#Pin: release o=LP-PPA-mozillateam
#Pin-Priority: 1001
#
#Package: thunderbird*
#Pin: release o=Ubuntu
#Pin-Priority: -1
#
#Package: firefox*
#Pin: release o=Ubuntu
#Pin-Priority: -1
#EOF

# For firefox-beta
#sudo mkdir -p /etc/apt/keyrings
#wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
#echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee /etc/apt/sources.list.d/mozilla.list > /dev/null
#sudo apt-get update && sudo apt-get -y --allow-downgrades install firefox-beta

# For firefox via ppa
#sudo add-apt-repository ppa:mozillateam/ppa
#sudo apt-get update && sudo apt-get -y --allow-downgrades install firefox

# Firefox from Mozilla
# https://support.mozilla.org/en-US/kb/install-firefox-linux?as=u&utm_source=inproduct
# Create a directory to store APT repository keys if it doesn't exist:

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

# Import the Mozilla APT repository signing key:

wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null

# The fingerprint should be 35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3. You may check it with the following command:

gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | 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"}'

# Next, add the Mozilla APT repository to your sources list:

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

# Configure APT to prioritize packages from the Mozilla repository:

# Clean old preferences
sudo rm -f /etc/apt/preferences.d/mozilla-firefox
sudo rm -f /etc/apt/preferences.d/mozilla-thunderbird

# New preferences
echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000

Package: firefox*
Pin: release o=Ubuntu
Pin-Priority: -1
' | sudo tee /etc/apt/preferences.d/mozilla

echo "ls -al /etc/apt/preferences.d/"
ls -al /etc/apt/preferences.d/

# Update your package list, and install the Firefox .deb package:

sudo apt-get update && sudo apt-get install firefox

echo
echo "Firefox DEB should now be installed."
echo "===================================="
echo
sleep 1
echo "If you want Thunderbird e-mail as DEB package, install with command:"
#echo "    sudo apt-get install thunderbird"
echo "    thunderbird-deb-install"
sleep 1
echo "Recommending extra packages:"
echo "    firetools firejail"
sleep 1
echo "to sandbox Firefox. Install with command:"
sleep 1
echo "    sudo apt-get install firetools firejail"
sleep 1
echo "Start firefox in sandbox:"
sleep 1
echo "    firejail firefox"
sleep 1
echo
echo "[OK] Done."
openSUSE Build Service is sponsored by