Last active
December 20, 2017 22:20
-
-
Save lucasmoreiradev/4c202dfd4ac9b49d8bd96b7ba84d8d22 to your computer and use it in GitHub Desktop.
install-chrome-on-ubuntu.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GIST SOURCE: https://gist.github.com/praphull27/6950d2a6c76a6e68acb7 | |
###################################################################### | |
echo "##### Add Google Chrome's repo to sources..." | |
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list | |
# Install Google's public key used for signing packages (e.g. Chrome) | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
# Update apt sources | |
sudo apt-get update | |
sudo apt-get install unzip | |
echo "##### Installing Headless Chrome dependencies..." | |
sudo apt-get install -y libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4 | |
sudo apt-get install -y google-chrome-stable | |
sudo apt-get install -y xvfb gtk2-engines-pixbuf | |
sudo apt-get install -y xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable | |
sudo apt-get install -y imagemagick x11-apps | |
## Since https://wiki.jenkins-ci.org/display/JENKINS/ChromeDriver+plugin doesn't work... | |
echo "##### Downloading latest ChromeDriver..." | |
LATEST=$(wget -q -O - http://chromedriver.storage.googleapis.com/LATEST_RELEASE) | |
sudo wget http://chromedriver.storage.googleapis.com/$LATEST/chromedriver_linux64.zip | |
echo "##### Extracting and symlinking chromedriver to PATH so it's available globally" | |
sudo unzip chromedriver_linux64.zip && sudo ln -s $PWD/chromedriver /usr/local/bin/chromedriver | |
# echo "##### Starting X virtual framebuffer (Xvfb) in background..." | |
# xdpyinfo -display :99 >/dev/null 2>&1 && echo "Xvfb @99 is in use" || echo "Xvfb @99 is free" | |
# Xvfb -ac :99 -screen 0 1280x1024x16 & | |
# export DISPLAY=:99 | |
# xdpyinfo -display :99 >/dev/null 2>&1 && echo "Xvfb @99 is in use" || echo "Xvfb @99 is free" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment