Skip to content

Instantly share code, notes, and snippets.

@d5
Last active January 2, 2016 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d5/8313028 to your computer and use it in GitHub Desktop.
Save d5/8313028 to your computer and use it in GitHub Desktop.
curl "https://gist.sh/8313028" | sudo sh
#!/bin/sh
# RHEL 64bit/32bit
# SUSE 64bit/32bit
# Amazon Linux 64bit/32bit
# Ubuntu 64bit/32bit
info() { echo "INFO: $1"; }
die() { echo "ERROR: $1. Aborting!"; exit 1; }
info "update all packages"
if type yum > /dev/null 2>&1; then
if ! yum repolist all 2> /dev/null | grep epel > /dev/null 2>&1; then
info "install EPEL repo"
ARCH=`uname -i`
curl -O http://download-i2.fedoraproject.org/pub/epel/6/$ARCH/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
fi
yum update -y
fi
if type zypper > /dev/null 2>&1; then
zypper --non-interactive update
fi
if type apt-get > /dev/null 2>&1; then
apt-get update -y
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment