Skip to content

Instantly share code, notes, and snippets.

@cellularmitosis cellularmitosis/README.md
Last active Oct 17, 2019

Embed
What would you like to do?
Install clojure on Debian stretch (9)
#!/bin/bash
set -e -o pipefail
set -x
# remove any debian version of clojure
if dpkg -l | grep '^ii' | awk '{print $2}' | grep clojure >/dev/null; then
apt-get -y remove '.*clojure.*'
fi
# install java 8
if ! dpkg -l | grep 8-jdk >/dev/null ; then
apt-get -y install openjdk-8-jdk
fi
# make java 8 the default
if ! java -version 2>&1 | head -n1 | grep '1\.8' >/dev/null; then
update-java-alternatives -s $( update-java-alternatives -l | awk '{print $1}' | grep '1\.8' )
fi
# install clojure
install="no"
if ! which clojure >/dev/null; then
install="yes"
elif ! cat `which clojure` | grep '1\.10' >/dev/null; then
install="yes"
fi
if [ "$install" = "yes" ]; then
apt-get -y install curl rlwrap
cd /tmp
curl -O https://download.clojure.org/install/linux-install-1.10.0.411.sh
chmod +x linux-install-1.10.0.411.sh
./linux-install-1.10.0.411.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.