You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			35 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Bash
		
	
			
		
		
	
	
			35 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Bash
		
	
#!/bin/bash
 | 
						|
 | 
						|
DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"
 | 
						|
 | 
						|
function error {
 | 
						|
  echo -e "\\e[91m$1\\e[39m"
 | 
						|
  exit 1
 | 
						|
}
 | 
						|
 | 
						|
# Add repository source to apt sources.list
 | 
						|
echo "Adding ubuntu repository..."
 | 
						|
echo "deb http://ports.ubuntu.com/ubuntu-ports bionic-updates main" | sudo tee /etc/apt/sources.list.d/firefox-ubuntu.list || error "Failed to add repository to sources.list!"
 | 
						|
 | 
						|
# Add ubuntu keyring
 | 
						|
echo "Signing ubuntu repository..."
 | 
						|
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
 | 
						|
if [ $? != 0 ];then
 | 
						|
  sudo rm -f /etc/apt/sources.list.d/firefox-ubuntu.list
 | 
						|
  error "Failed to sign the bionic-updates repository!"
 | 
						|
fi
 | 
						|
 | 
						|
# Add preferences so the ubuntu repositories don't become your "default" repositories
 | 
						|
echo "Preventing Ubuntu repository from causing apt problems..."
 | 
						|
sudo wget -O /etc/apt/preferences.d/99bionic-updates https://raw.githubusercontent.com/chunky-milk/pi-bashscripts-files/main/Files/99bionic-updates
 | 
						|
if [ $? != 0 ];then
 | 
						|
  sudo rm -f /etc/apt/sources.list.d/firefox-ubuntu.list
 | 
						|
  error "wget failed to download 99bionic-updates config file!"
 | 
						|
fi
 | 
						|
 | 
						|
echo "Running 'sudo apt update'..."
 | 
						|
sudo apt update || error "Failed to run 'sudo apt update'!"
 | 
						|
 | 
						|
echo "Installing Firefox package..."
 | 
						|
sudo apt install -t bionic-updates firefox -y || error "Failed to install firefox!"
 |