-
Notifications
You must be signed in to change notification settings - Fork 2
/
fix_ubuntu_firefox.sh
executable file
·34 lines (26 loc) · 1.07 KB
/
fix_ubuntu_firefox.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env sh
set -eu
# Ubuntu 22.04 installs Firefox as snap by default,
# and the deb package is merely a wrapper for the snap.
# To get some extensions such as KeePassXC working,
# one has to install Firefox from the Mozilla PPA.
# Source:
# https://www.omgubuntu.co.uk/2022/04/how-to-install-firefox-deb-apt-ubuntu-22-04
echo "Creating a backup of the existing Firefox profile"
cp -r "${HOME}/snap/firefox" "${HOME}/snap/firefox-backup-$(date +%s)"
echo "Removing the Firefox snap"
sudo snap remove firefox
sudo apt-get remove firefox
echo "Adding the Mozilla PPA"
sudo add-apt-repository ppa:mozillateam/ppa
echo "Altering Firefox package priority to prefer the PPA version"
echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox
echo "Configuring unattended upgrades"
# shellcheck disable=SC2016
echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox
echo "Installing Firefox from the PPA"
sudo apt install firefox