I have installed leiningen using this script. How can I uninstall it?

I tried this SO solution but it says self-install is deprecated.

  • 1
    # Ensure this file is executable via chmod a+x lein, then place it # somewhere on your $PATH, like ~/bin. The rest of Leiningen will be # installed upon first run into the ~/.lein/self-installs directory. So I guess you should delete that directory. – Zanna Apr 22 '17 at 7:30
  • ~/.lein/self-installs ? – Tarun Maganti Apr 22 '17 at 7:33
  • That Worked. You could write an answer – Tarun Maganti Apr 22 '17 at 7:37

The script has some helpful comments at the start:

# Ensure this file is executable via `chmod a+x lein`, then place it
# somewhere on your $PATH, like ~/bin. The rest of Leiningen will be
# installed upon first run into the ~/.lein/self-installs directory.

So to uninstall it, in theory you only need remove that directory

rm -r ~/.lein

assuming you did not run the script as root.

If you might want to reinstall the program in the future, you can keep the script; since it's in a path location, typing lein would cause the script to be run again, reinstalling the software. If you don't want this to happen, delete the script itself (rm ~/bin/lein assuming that is the path to it) or remove execute permission from it (chmod -x ~/bin/lein).

  • I would like to point out that if that script isn't removed, running lein in terminal will result in redownloading of the leiningen – Tarun Maganti Apr 22 '17 at 7:48
  • 1
    If you are removing this as you want to install a different version of lein (to fix issues with 2.8.2 for example) then leave the script under ~/bin and change the line under LEIN_VERSION= to the version you need then run lein and lein repl to get up and running again – 8bitme Dec 14 '18 at 9:41
  • @8bitme great tip - you could post that as an answer I think... – Zanna Dec 14 '18 at 9:55

If you are trying to remove Lein to change the version that you are using because you are running into an issue similar to the one described here on GitHub then remove Lein as mentioned by Zanna:

rm -r ~/.lein

Update the version of Lein to the one you need in the lein script (the one you downloaded from the lein site possibly under ~/bin/lein):

export LEIN_VERSION="2.8.2"

Change this to the version you want (in my case changing this to 2.8.1 resolved the issue).

Install Lein again by running:


Confirm all is in order by trying to run the repl:

lein repl

If you get something similar to the following you have successfully installed Lein:

 nREPL server started on port 50634 on host - nrepl://
 REPL-y 0.3.7, nREPL 0.2.12
 Clojure 1.8.0
 Java HotSpot(TM) 64-Bit Server VM 1.8.0_121-b13
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

1) Find where did you place this executable and delete it:

$ which lein # returns /path/to/lein
$ sudo rm /path/to/lein

2) Remove lein cache/config folder

$ rm -Rf ~/.lein

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.