Skip to content

Instantly share code, notes, and snippets.

@elbaby
Forked from jprenken/install-chrome.sh
Last active August 9, 2024 20:59
Show Gist options
  • Save elbaby/fa18ad2fe34cfa212dd5c0303d980fe0 to your computer and use it in GitHub Desktop.
Save elbaby/fa18ad2fe34cfa212dd5c0303d980fe0 to your computer and use it in GitHub Desktop.
Install Chrome on Debian / Ubuntu the pedantic way
#!/bin/bash
# Install Chrome on Debian/Ubuntu the pedantic way
# https://gist.github.com/elbaby/fa18ad2fe34cfa212dd5c0303d980fe0
# by Baby https://clueless.ar - https://www.marianoabsatz.com
# https://github.com/elbaby - https://gitlab.com/el_baby
# adapted from https://gist.github.com/jprenken/92757c76b24caec8718231205238eaf1
# kudos to James Renken https://github.com/jprenken
sudo mkdir --parents --verbose /etc/apt/keyrings
curl --fail --silent --show-error --location https://dl.google.com/linux/linux_signing_key.pub \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/google.gpg > /dev/null
cat <<EOF | sudo tee /etc/apt/sources.list.d/google-chrome.list >/dev/null
# Manually configured via https://gist.github.com/elbaby/fa18ad2fe34cfa212dd5c0303d980fe0
# If this goes wrong, blame https://github.com/elbaby or Google ;-)
deb [arch=amd64 signed-by=/etc/apt/keyrings/google.gpg] https://dl.google.com/linux/chrome/deb/ stable main
EOF
# We want to manage the Google Chrome repository manually, so that we can use
# the modern `signed-by` method of trusting their key only for their repo, not
# globally.
sudo tee /etc/default/google-chrome <<EOF >/dev/null
repo_add_once=false
repo_reenable_on_distupgrade=false
EOF
# They'll auto-install their key globally daily, but we don't want it there.
sudo ln --symbolic /dev/null /etc/apt/trusted.gpg.d/google-chrome.gpg
sudo apt-get update
sudo apt-get --assume-yes install google-chrome-stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment