# Official Linux script to install Clojure vs. Clojure from Debian 11 Repo

**URL:** <https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965>\
**Category:** How to?\
**Created:** [January 1, 2021, 12:58pm UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965 "2021-01-01T12:58:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![robert](https://clojureverse.org/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@robert](https://clojureverse.org/u/robert)\
**Post date:** [January 1, 2021, 12:58pm UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965/1 "2021-01-01T12:58:34Z")

</div>

Hi Everybody,

When possible I always use packages from official Linux distro repo. In my case it’s Debian 11 (Bullseye / Testing / Next-Stable):

- Deb. package: [https://packages.debian.org/bullseye/clojure](https://packages.debian.org/bullseye/clojure)
- Debian Wiki: [https://wiki.debian.org/Clojure](https://wiki.debian.org/Clojure)
- Debian Git: [https://salsa.debian.org/clojure-team](https://salsa.debian.org/clojure-team)

I was curious what official Linux installation script does different so in one Debian VM I installed VSCode (Codium in my case), Calva and Clojure using [https://download.clojure.org/install/linux-install-1.10.1.763.sh](https://download.clojure.org/install/linux-install-1.10.1.763.sh) and in a second VM I installed Clojure by: `apt-get install openjdk-11-jdk clojure leiningen`

Comparing those two I noticed that Debian version does not have `clj` command. After checking man page I found that `clj` is not supposed to have REPL but after executing `clojure` command I entered same (I think) REPL as when I executed `clj` command.

Could you please tell me, Is there something I might/will miss when developing in Clojure installed from Debian repo? Is there a real difference between Clojure from repo and Clojure installed by the official script?

Thank you.

Kind regards,  
Robert

Happy New Year 2021 😉

---

<div class="post-metadata">

**Author:** ![Phill](https://clojureverse.org/letter_avatar_proxy/v4/letter/p/779978/32.png) [@Phill](https://clojureverse.org/u/Phill)\
**Post date:** [January 1, 2021, 2:26pm UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965/2 "2021-01-01T14:26:01Z")

</div>

Interesting experiment! If the Debian lacks `clj` then we may infer that it does not package the official, so to speak, Clojure wrappers.

The question is, essentially, “1.what Clojure-related parts does Debian package?” and “2.how often does Debian update them?”, so you might get the best answer by asking Debian about its policy for Clojure. Or go find Debian’s package definition “source code” for Clojure and see for yourself what’s inside and how responsively it has updated in the past, compared to Clojure upstream.

But I would go out on a limb and suggest not using any Linux distro’s packaging of Clojure, except when you are making a Clojure-based package that will itself become part of that distro! In short, in cases where you would naturally plan on updating your contributions in lockstep with the distro’s Clojure pieces, and to never desire any Clojure part that is newer or more complete than what the distro provides.

A Linux distro is really, really helpful as a curator of a “known-to-work” combination of the byzantine, tightly coupled, microscopically configurable, circularly dependent core packages, which are so painful to get working that no one cares exactly which version of each piece they have, as long as the whole integrated system works. In contrast, a Linux distro adds less value to Java jars, so we have the luxury of getting annoyed when we’ve chosen an update stream that may be several versions behind at times.

---

<div class="post-metadata">

**Author:** ![robert](https://clojureverse.org/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@robert](https://clojureverse.org/u/robert)\
**Post date:** [January 1, 2021, 4:09pm UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965/3 "2021-01-01T16:09:15Z")

</div>

Hi Phill,

Thank you very much for responding.

> [@Phill](#):
>
> 1.what Clojure-related parts does Debian package?

This is the source they use: [Debian Clojure Maintainers · GitLab](https://salsa.debian.org/clojure-team)

> [@Phill](#):
>
> 2.how often does Debian update them?

I would say it’s up-to-date.

`dpkg --list | grep clojure`

```auto
ii clojure 1.10.1-1 all Lisp dialect for the JVM
ii libclojure-java 1.10.1-1 all Lisp dialect for the JVM (library)
ii libcore-specs-alpha-clojure 0.2.44-3 all specs to describe Clojure core macros and functions
ii libspec-alpha-clojure 0.2.176-3 all library to describe the structure of data and functions

```

`clojure`

```auto
Clojure 1.10.1
user=>

```

> [@Phill](#):
>
> suggest not using any Linux distro’s packaging

I completely agree but it’d be so much easier if I could use Debian packaging. There is no security team on the planet that will like `curl x.sh | sudo bash`. But if I can use Debian packaging, I don’t need to ask anything to anyone. And we can discuss how to present the whole thing to a security team but this is not the point of this question. Please let’s not discuss that in this thread. Thank you.

**Some more details about packaging:**

`apt-file list clojure`

```auto
clojure: /etc/rlwrap/clojure1.10
clojure: /usr/bin/clojure1.10
clojure: /usr/bin/clojurec1.10
clojure: /usr/share/doc/clojure/README.Debian
clojure: /usr/share/doc/clojure/changelog.Debian.gz
clojure: /usr/share/doc/clojure/changelog.gz
clojure: /usr/share/doc/clojure/copyright
clojure: /usr/share/man/man1/clojure1.10.1.gz
clojure: /usr/share/man/man1/clojurec1.10.1.gz

```

`apt-file list libclojure-java`

```auto
libclojure-java: /usr/share/doc/libclojure-java/changelog.Debian.gz
libclojure-java: /usr/share/doc/libclojure-java/changelog.gz
libclojure-java: /usr/share/doc/libclojure-java/copyright
libclojure-java: /usr/share/java/clojure-1.10.1.jar
libclojure-java: /usr/share/java/clojure-1.10.jar
libclojure-java: /usr/share/maven-repo/org/clojure/clojure/1.10.1/clojure-1.10.1.jar
libclojure-java: /usr/share/maven-repo/org/clojure/clojure/1.10.1/clojure-1.10.1.pom
libclojure-java: /usr/share/maven-repo/org/clojure/clojure/1.10.x/clojure-1.10.x.jar
libclojure-java: /usr/share/maven-repo/org/clojure/clojure/1.10.x/clojure-1.10.x.pom

```

`apt-file list libcore-specs-alpha-clojure`

```auto
libcore-specs-alpha-clojure: /usr/share/doc-base/core-specs-alpha-clojure
libcore-specs-alpha-clojure: /usr/share/doc/libcore-specs-alpha-clojure/README.md
libcore-specs-alpha-clojure: /usr/share/doc/libcore-specs-alpha-clojure/changelog.Debian.gz
libcore-specs-alpha-clojure: /usr/share/doc/libcore-specs-alpha-clojure/changelog.gz
libcore-specs-alpha-clojure: /usr/share/doc/libcore-specs-alpha-clojure/copyright
libcore-specs-alpha-clojure: /usr/share/maven-repo/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar
libcore-specs-alpha-clojure: /usr/share/maven-repo/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.pom
libcore-specs-alpha-clojure: /usr/share/maven-repo/org/clojure/core.specs.alpha/debian/core.specs.alpha-debian.jar
libcore-specs-alpha-clojure: /usr/share/maven-repo/org/clojure/core.specs.alpha/debian/core.specs.alpha-debian.pom

```

`apt-file list libspec-alpha-clojure`

```auto
libspec-alpha-clojure: /usr/share/doc-base/spec-alpha-clojure
libspec-alpha-clojure: /usr/share/doc/libspec-alpha-clojure/README.md
libspec-alpha-clojure: /usr/share/doc/libspec-alpha-clojure/changelog.Debian.gz
libspec-alpha-clojure: /usr/share/doc/libspec-alpha-clojure/changelog.gz
libspec-alpha-clojure: /usr/share/doc/libspec-alpha-clojure/copyright
libspec-alpha-clojure: /usr/share/maven-repo/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar
libspec-alpha-clojure: /usr/share/maven-repo/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.pom
libspec-alpha-clojure: /usr/share/maven-repo/org/clojure/spec.alpha/debian/spec.alpha-debian.jar
libspec-alpha-clojure: /usr/share/maven-repo/org/clojure/spec.alpha/debian/spec.alpha-debian.pom

```

---

<div class="post-metadata">

**Author:** ![seancorfield](https://clojureverse.org/user_avatar/clojureverse.org/seancorfield/32/195_2.png) [@seancorfield](https://clojureverse.org/u/seancorfield)\
**Post date:** [January 1, 2021, 6:01pm UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965/4 "2021-01-01T18:01:29Z")

</div>

On Linux, I use brew (linuxbrew) for installing Clojure, so I have the same install/maintenance process on my Mac desktop and also on my laptop. It also makes it easy to install specific older versions for testing. And it makes sure you get the official Cognitect version of the Clojure CLI.

---

<div class="post-metadata">

**Author:** ![didibus](https://clojureverse.org/user_avatar/clojureverse.org/didibus/32/951_2.png) [@didibus](https://clojureverse.org/u/didibus)\
**Post date:** [January 1, 2021, 8:20pm UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965/5 "2021-01-01T20:20:27Z")

</div>

Linuxbrew also doesn’t require sudo, so concerns around a security team should be mitigated.

As to the OP’s question. `clj` is GNU read line wrapped version of `clojure`. So that’s what you’ll be missing. That said, you can probably create yourself a `clj` alias that does the same rl-wrapping.

---

<div class="post-metadata">

**Author:** ![seancorfield](https://clojureverse.org/user_avatar/clojureverse.org/seancorfield/32/195_2.png) [@seancorfield](https://clojureverse.org/u/seancorfield)\
**Post date:** [January 1, 2021, 8:29pm UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965/6 "2021-01-01T20:29:23Z")

</div>

You’re assuming that `clojure` is the same `clojure` script from the official CLI stuff…

@robert If you run `clojure -Sdescribe` what output do you get?

You should see something like this if it’s the official CLI:

```auto
(! 502)-> clojure -Sdescribe
{:version "1.10.1.763"
 :config-files ["/usr/local/Cellar/clojure@1.10.1.763/1.10.1.763/deps.edn" "/Users/sean/.clojure/deps.edn"]
 :config-user "/Users/sean/.clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/Cellar/clojure@1.10.1.763/1.10.1.763"
 :config-dir "/Users/sean/.clojure"
 :cache-dir "/Users/sean/.clojure/.cpcache"
 :force false
 :repro false
 :main-aliases ""
 :repl-aliases ""}

```

---

<div class="post-metadata">

**Author:** ![robert](https://clojureverse.org/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@robert](https://clojureverse.org/u/robert)\
**Post date:** [January 3, 2021, 3:15pm UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965/7 "2021-01-03T15:15:13Z")

</div>

Thank you very much both @didibus and @seancorfield.

After reviewing again differences between Debian and official version I realized that the main (only) difference is (as you correctly pointed out):

```auto
/usr/local/lib/clojure/libexec/exec.jar
/usr/local/lib/clojure/libexec/clojure-tools-1.10.1.763.jar
/usr/local/lib/clojure/deps.edn
/usr/local/lib/clojure/example-deps.edn
/usr/local/bin/clojure
/usr/local/bin/clj

```

Both `clojure` and `clj` are shell scripts. `clj` is missing in Debian version and `clojure` (in `/bin/clojure`) is also a shell script and much simpler (shorter).

`wc -l /bin/clojure /usr/local/bin/clojure`

```auto
   26 /bin/clojure
  435 /usr/local/bin/clojure

```

`/bin/clojure -Sdescribe`

```auto
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-Sdescribe (No such file or directory)

Full report at:
/tmp/clojure-9054386668500752730.edn

```

uuups 😉

and I copied the shell script and files from /usr/local/lib/ into the installed Debian version and:  
`/usr/local/bin/clojure -Sdescribe`

```auto
{:version "1.10.1.763"
 :config-files ["/usr/local/lib/clojure/deps.edn" "/home/user/.clojure/deps.edn"]
 :config-user "/home/user/.clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/lib/clojure"
 :config-dir "/home/user/.clojure"
 :cache-dir "/home/user/.clojure/.cpcache"
 :force false
 :repro false
 :main-aliases ""
 :repl-aliases ""}

```

So I guess I can copy the files (/usr/local/lib/\* and /usr/local/bin/clj, /usr/local/bin/clojure) into the Debian version or maybe even better try Linuxbrew (I didn’t even know brew works on Linux, thank you for letting me know).

---

<div class="post-metadata">

**Author:** ![tomekw](https://clojureverse.org/user_avatar/clojureverse.org/tomekw/32/3080_2.png) [@tomekw](https://clojureverse.org/u/tomekw)\
**Post date:** [February 5, 2021, 12:24pm UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965/8 "2021-02-05T12:24:28Z")

</div>

Hi @robert! 👋

And what did you come up with? Using a packaged version with some tweaks or installing manually?

---

<div class="post-metadata">

**Author:** ![robert](https://clojureverse.org/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@robert](https://clojureverse.org/u/robert)\
**Post date:** [April 24, 2021, 3:51pm UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965/9 "2021-04-24T15:51:33Z")

</div>

Apologizes for late answer @tomekw

> [@tomekw](#):
>
> And what did you come up with? Using a packaged version with some tweaks or installing manually?

Both, I installed Debian package and I manually added:

```auto
/usr/local/lib/
├── clojure
│ ├── deps.edn
│ ├── example-deps.edn
│ └── libexec
│ ├── clojure-tools-1.10.1.763.jar
│ └── exec.jar
/usr/local/bin/
├── clj
├── clojure

```

And works great since January.

Recently I read [How to install Clojure v1.11 Alfa on Linux?](https://v2.clojureverse.org/t/how-to-install-clojure-v1-11-alfa-on-linux/7564) topic which is also a reason I noticed your question and I changed deps.edn in my home folder and again it’s working without any issue and I’m rocking 1.11 alfa 😃

---

<div class="post-metadata">

**Author:** ![system](https://clojureverse.org/uploads/default/original/2X/5/51079bf9e4b7d9466242c06cf1e43b9f8bd6da14.png) [@system](https://clojureverse.org/u/system)\
**Post date:** [October 24, 2021, 3:51am UTC](https://clojureverse.org/t/official-linux-script-to-install-clojure-vs-clojure-from-debian-11-repo/6965/10 "2021-10-24T03:51:49Z")

</div>

Closed on October 24, 2021, 3:51am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
