Skip to content

Instantly share code, notes, and snippets.

@figital
Created July 22, 2011 21:28
Show Gist options
  • Save figital/1100470 to your computer and use it in GitHub Desktop.
Save figital/1100470 to your computer and use it in GitHub Desktop.
a shell script to download the most recent chromium build for linux
#/bin/sh
# quick hack to automate local user bleeding-edge chromium build installs
# how do you like to call this program? (chrome-linux, chrome, chromium, google-chrome?)
APPNAME="chromium"
# get the latest build number (JSON)
VERSION=$(wget -qO- http://build.chromium.org/f/chromium/snapshots/Linux/LATEST)
# get some extra metadata to display on the command line
LOGURL="http://build.chromium.org/f/chromium/snapshots/Linux/"$VERSION"/REVISIONS"
LOG=$(wget -qO- $LOGURL)
# build the URL of the file we'll be downloading
DOWNLOADURL="http://build.chromium.org/f/chromium/snapshots/Linux/"$VERSION"/chrome-linux.zip"
# Here's some command line output ...
echo -e "\r\n-------------------------"
echo "BUILD: "$VERSION
echo $LOGURL
echo $LOG
echo -e "-------------------------\r\n"
# if this was already downloaded, then it would either need to be deleted or aborted
# where should we put this 37MB download?
tempfile="/tmp/chrome-linux-"$VERSION".zip"
tempdir="/tmp/chrome-linux/"$VERSION
# just putting this in my home directory now because i'm lazy
permdir=~/$APPNAME"/"$VERSION
# get the large download ...
wget $DOWNLOADURL -O $tempfile
mkdir -p $permdir
unzip $tempfile -d $permdir
# if the symlink exists it needs to be removed now
# actually, this should be linked to the user's personal bin space and sudo/password wouldn't be needed ...
# (so for time being it's needing password :(
sudo rm "/usr/local/bin/"$APPNAME
sudo ln -s $permdir"/chrome-linux/chrome" "/usr/local/bin/"$APPNAME
echo "All done! ...."
# you forgot to delete the tempdir stuff after the unzipping :(
# although it's in /tmp and should be wiped next reboot
@figital
Copy link
Author

figital commented Jul 25, 2011

some things to do:

  • turn off extra output for wget and unzip
  • check out @cowboy's script for extra goodness
  • fix sudo/userspace problem

@cowboy
Copy link

cowboy commented Jul 25, 2011

You can probably just change the "Mac" or "mac" parts of the name to make mine work in Linux. I haven't tested this, however, but it might be worth a shot.

@karuppasamy
Copy link

It's not working for me. I think, the URL http://build.chromium.org/f/chromium/snapshots/Linux/LATEST is not found. Please update with working URL.

@cowboy
Copy link

cowboy commented Nov 28, 2011

FWIW, my version still works. It's meant for OS X, but should be easily tweakable: https://gist.github.com/1093476

@karuppasamy
Copy link

OH!! Sorry I'm using Linux Fedora Core 8 version. Can you please give me the script for Linux (Fedora core 8)?. Thanks.

@figital
Copy link
Author

figital commented Nov 28, 2011

I had moved this to its own repo awhile ago which has the updated URL(s): https://github.com/figital/get-chromium. I use this every few days on a recent build of CrunchBang which is Debian-based.

You should also certainly checkout @cowboy's scripts which have some nice extra functionality and are tuned for OSX.

@figital
Copy link
Author

figital commented Nov 28, 2011

I'd be interested in testing/tuning the script for Fedora Core 16 ... but I'll leave version 8 up to you Samy ;).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment