2021-06-02 09:16:55 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2021-07-02 22:55:46 +03:00
|
|
|
is_user_root () { [ "${EUID:-$(id -u)}" -eq 0 ]; }
|
|
|
|
if is_user_root; then
|
|
|
|
maybesudo=""
|
|
|
|
else
|
|
|
|
maybesudo="sudo"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2021-06-02 09:16:55 +03:00
|
|
|
# 1. make sure to remove old stable if any.
|
|
|
|
if dpkg --get-selections | grep -q "^google-chrome[[:space:]]*install$" >/dev/null; then
|
2021-07-02 22:55:46 +03:00
|
|
|
$maybesudo apt-get remove -y google-chrome
|
2021-06-02 09:16:55 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# 2. download chrome stable from dl.google.com and install it.
|
|
|
|
cd /tmp
|
|
|
|
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
2021-07-02 22:55:46 +03:00
|
|
|
$maybesudo apt-get install -y ./google-chrome-stable_current_amd64.deb
|
2021-06-02 09:16:55 +03:00
|
|
|
rm -rf ./google-chrome-stable_current_amd64.deb
|
|
|
|
cd -
|
2021-06-07 10:23:22 +03:00
|
|
|
google-chrome --version
|