13

I noticed that there is a package repo for Clojure, so I tried

sudo apt-get install clojure

However, the install failed, it looks like there is a java dependency missing.

I have java installed correctly on my machine: javac -version results 1.6.0_26.

In any case, I find leiningan is always an easy way to go, but thought I would try apt-get to see if it was working. Any thoughts on this error message?

The following packages have unmet dependencies:
 clojure : Depends: libasm3-java but it is not going to be installed
peterh
  • 11,875
  • 18
  • 85
  • 108
jayunit100
  • 17,388
  • 22
  • 92
  • 167
  • 2
    possible duplicate of [How to install Clojure on Ubuntu 10.04 from Github repo with no clojure.jar](http://stackoverflow.com/questions/5983427/how-to-install-clojure-on-ubuntu-10-04-from-github-repo-with-no-clojure-jar) – amalloy Oct 21 '11 at 03:55
  • 8
    Are you on ubuntu 10.10? It installs without problems on Ubuntu 10.04. However I would strongly **recommend against** installing clojure from the repos - In ubuntu 10.10 the version shipped is clojure 1.1.0, the current version of clojure is 1.3.0. Clojure evolves pretty fast so to stay up to date leiningen is a much better option. – Paul Oct 21 '11 at 07:14

4 Answers4

24

To summarize the comments:

Yes, apt-get works

... BUT it it is not the preferred way to install Clojure.

So ... whats the "right" way to install Clojure ?

Leiningen remains the up-to-date, conventional way to rapidly get a Clojure installation up and running.

The steps are as follows :

  1. copying this shell script: https://raw.github.com/technomancy/leiningen/stable/bin/lein
  2. moving it to /usr/local/bin
  3. calling sudo chmod +x /usr/local/bin/lein.

Make sure you have Java installed first, of course.

These steps will install Clojure on any platform with the latest version.

jayunit100
  • 17,388
  • 22
  • 92
  • 167
7

Just a no-brainer script to install leiningen:

cd `mktemp -d`
wget https://raw.github.com/technomancy/leiningen/stable/bin/lein
chmod +x lein 
sudo mv lein /usr/local/bin/
lein help
cd -
Alexey
  • 9,197
  • 5
  • 64
  • 76
6

apt-get install leiningen works, and easily installs Clojure dependencies (including ones you probably don't need, but it is easy). Debian sid has 1.7.1, which is the most recent stable version; Ubuntu 12.04 has this available in universe. Then you can follow the lein instructions.

Leiningen 2.0 is coming soon; maybe that will become available in a PPA when it is finalized.

Gary Poster
  • 61
  • 1
  • 1
1

See recommendations from official site http://clojure.org/downloads . "Get Clojure via Leiningen" section.