Skip to content

Instantly share code, notes, and snippets.

@sndsgd
Created July 15, 2014 17:51
Show Gist options
  • Save sndsgd/def557d046a3a005b852 to your computer and use it in GitHub Desktop.
Save sndsgd/def557d046a3a005b852 to your computer and use it in GitHub Desktop.
install imagemagick from source on ubuntu 14.04
#!/bin/bash
CWD=$(pwd)
TMP_DIR=/tmp/install-imagemagick
if [ "$UID" -ne 0 ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
if [[ ! -d $TMP_DIR ]]; then
mkdir -p $TMP_DIR
fi
apt-get update
apt-get remove imagemagick
apt-get install \
libmagick++-dev \
libwebp-dev \
# download the latest source archive
wget -O $TMP_DIR/ImageMagick.tar.gz \
http://www.imagemagick.org/download/ImageMagick.tar.gz
# extract the archive and change into the source dir
tar -xvzf $TMP_DIR/ImageMagick.tar.gz -C $TMP_DIR
cd $TMP_DIR/$(ls $TMP_DIR | grep -E 'ImageMagick-[0-9.-]+')
./configure --prefix=/usr
make
make install
cd $CWD
# cleanup
rm -rf $TMP_DIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment