Skip to content

Instantly share code, notes, and snippets.

@Hakier
Last active October 4, 2023 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hakier/7c7a11c33d62a4502409382e8eaa8051 to your computer and use it in GitHub Desktop.
Save Hakier/7c7a11c33d62a4502409382e8eaa8051 to your computer and use it in GitHub Desktop.
install-google-chrome.sh

How to install Google Chrome on Debian-based Linux

To install a stable version you can call any of the fallowing commands:

curl -o- https://gist.githubusercontent.com/Hakier/7c7a11c33d62a4502409382e8eaa8051/raw/install-google-chrome.sh | bash
wget -qO- https://gist.githubusercontent.com/Hakier/7c7a11c33d62a4502409382e8eaa8051/raw/install-google-chrome.sh | bash

To install a beta version you can call any of the fallowing commands:

curl -o- https://gist.githubusercontent.com/Hakier/7c7a11c33d62a4502409382e8eaa8051/raw/install-google-chrome.sh | bash -s - --beta
wget -qO- https://gist.githubusercontent.com/Hakier/7c7a11c33d62a4502409382e8eaa8051/raw/install-google-chrome.sh | bash -s - --beta
#!/usr/bin/env bash
function addGoogleChromeRepository {
echo "> Downloading the Google signing key and installing it..."
wget -qO - https://dl.google.com/linux/linux_signing_key.pub |
sudo gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg
echo "> Setting up the Google Chrome repository..."
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" |
sudo tee /etc/apt/sources.list.d/google-chrome.list
}
function installGoogleChrome {
echo "> Updating the repository index..."
sudo apt update
case "${1}" in
--beta)
echo "> Installing Google Chrome Beta"
sudo apt install -y google-chrome-beta
;;
*)
echo "> Installing Google Chrome Stable..."
sudo apt install -y google-chrome-stable
;;
esac
}
case "${1}" in
-h | --help)
echo "${0} [--beta]"
;;
*)
version="${1:---stable}"
addGoogleChromeRepository &&
installGoogleChrome "${version}"
;;
esac
@mdaminulislamasif
Copy link

i love you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment