Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save IsaacChapman/df3d28c6676a29077696bdb68507b79e to your computer and use it in GitHub Desktop.
Save IsaacChapman/df3d28c6676a29077696bdb68507b79e to your computer and use it in GitHub Desktop.
Install google-chrome-[un]stable on Ubuntu 12 LTS
#!/bin/bash
# Install latest versions of Google Chrome (stable and unstable) on Ubuntu 12.04 LTS
# Google does not support latest versions of Chrome on Ubuntu 12, but it works after re-writing the .deb file requirements
# (specifically 'lsb-base' and 'libfontconfig1')
# From by http://askubuntu.com/questions/758571/google-chrome-stable-depends-on-libstdc6-4-8-0-however-version-of-libs
cwd=`pwd`
# make temp directory
temp_dir=$(mktemp -d "${TMPDIR:-/tmp/}google-chrome-install.XXXXXXXXX")
mkdir -p $temp_dir
cd $temp_dir
# stable
rm -rf build && mkdir build
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg-deb -x google-chrome-stable_current_amd64.deb build/
dpkg-deb --control google-chrome-stable_current_amd64.deb build/DEBIAN
perl -pe 's|lsb-base \(\>\= 4\.1\)|lsb-base \(\>\= 4\.0\)|g' "build/DEBIAN/control" > "build/DEBIAN/control.1"
perl -pe 's|libfontconfig1 \(\>\= 2\.9\.0\)|libfontconfig1 \(\>\= 2\.8\.0\)|g' "build/DEBIAN/control.1" > "build/DEBIAN/control"
dpkg -b build google-chrome-stable_current_amd64-modified.deb
sudo dpkg -i google-chrome-stable_current_amd64-modified.deb
ls -l /opt/google/chrome/
# unstable
rm -rf build && mkdir build
wget https://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
dpkg-deb -x google-chrome-unstable_current_amd64.deb build/
dpkg-deb --control google-chrome-unstable_current_amd64.deb build/DEBIAN
perl -pe 's|lsb-base \(\>\= 4\.1\)|lsb-base \(\>\= 4\.0\)|g' "build/DEBIAN/control" > "build/DEBIAN/control.1"
perl -pe 's|libfontconfig1 \(\>\= 2\.9\.0\)|libfontconfig1 \(\>\= 2\.8\.0\)|g' "build/DEBIAN/control.1" > "build/DEBIAN/control"
dpkg -b build google-chrome-unstable_current_amd64-modified.deb
sudo dpkg -i google-chrome-unstable_current_amd64-modified.deb
ls -l /opt/google/chrome-unstable/
# cleanup
cd $cwd
rm -rf $temp_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment