Anonymous
Not applicable

I had to install a Chromium based browser on databricks as it was required by the R package Webshot2.

After trying a lot of things, I was able to install google-chrome using this script.
Our cluster is running DBX Runtime 13.1 which is based on Ubuntu 22.04.2 LTS

%sh
#Add the package signing key for google and add repository to sourcelist.d
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update

#You might have to do this if you run into issue with broken repositoy while pulling dependencies for your release.
wget http://ge.archive.ubuntu.com/ubuntu/pool/main/m/mesa/libgbm1_22.0.1-1ubuntu2_amd64.deb
sudo apt install -y ./libgbm1_22.0.1-1ubuntu2_amd64.deb

#Finally install chrome. And since the R function invoking didn't have option to pass args, I had to add the --no-sandbox directly to the launcher script.
sudo apt install -y google-chrome-stable
sudo sed -i '$ s/$/'" --no-sandbox"'/' /opt/google/chrome/google-chrome