Skip to content

Instantly share code, notes, and snippets.

@mr-bat
Forked from LoganGray/chromeinstall_ubu16.sh
Created November 24, 2021 20:53
Show Gist options
  • Save mr-bat/c48a409b90fde90356380f53a1fc5e89 to your computer and use it in GitHub Desktop.
Save mr-bat/c48a409b90fde90356380f53a1fc5e89 to your computer and use it in GitHub Desktop.
this worked to install selenium and google chrome on my Ubuntu 16 server.
#!/usr/bin/env bash
# used to install offical chrome and selenium on Ubuntu 16.04.1 LTS, 18.04, 20.04.1 LTS desktop, Jan 2021
# also tested and works on Elem OS 5.1 :)
#
# make sure script is run as root or sudo
if [[ $(whoami) != "root" ]] ; then
echo ; echo "This script, $0, SHOULD be run as ROOT. " ; echo
exit 1
fi
#
cd ~
sudo apt-get update
sudo apt install -y python3-pip
pip install simplejson
pip install bs4
pip install selenium
sudo apt-get install -y libasound2 libnspr4 libnss3 libxss1 xdg-utils unzip libappindicator1 fonts-liberation
apt-get -f install
wget http://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
# chromedriver also needs to be installed.
CHROME_VERSION=$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE)
wget https://chromedriver.storage.googleapis.com/$CHROME_VERSION/chromedriver_linux64.zip
#wget http://chromedriver.storage.googleapis.com/2.45/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
sudo mv chromedriver /usr/bin/chromedriver
sudo chown root:root /usr/bin/chromedriver # questionable - may need to add other user permissions
sudo chmod +x /usr/bin/chromedriver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment