Skip to content

Instantly share code, notes, and snippets.

@kunthar
Last active August 27, 2021 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunthar/06e3c2d04963ed3eb45b6a7e0395c73b to your computer and use it in GitHub Desktop.
Save kunthar/06e3c2d04963ed3eb45b6a7e0395c73b to your computer and use it in GitHub Desktop.
asdf crash course

Manage multiple runtime versions with a single CLI tool

  • asdf is cool tool if you have a limited disk space.
  • Nor docker containers neither Nixos packages can help when disk space is really small as most of Macs has.
  • You can test a new language or tool, see the results and remove without having leftover in your system if you like to.
  • install asdf with git
  • Btw, you can check the snapd if you are on Ubuntu!

https://asdf-vm.com/#/core-manage-asdf-vm

Sample plugin installation steps

asdf plugin-list-all  #show all plugins could be installed
asdf plugin-add java #add this plugin to local asdf repo
asdf list all java # show all versions of this plugin
asdf install java adopt-openjdk-8u242-b08 # select version to install
asdf global java adopt-openjdk-8u242-b08 #set global version of java for OS
asdf local java adopt-openjdk-8u242-b08 #set local version of java only valid for THIS shell
asdf reshim #reshim commands when needed. read reshim for more info

where is asdf? check sub dirs to see what is where.

~/.asdf

Possible Problems

  • Some programming languages could need additional libs for your OS to compile. Double check if you have necessary libs before you go ahead. For MacOS i prefer to use Macports. You can select brew too. YMMV.
  • Always remember that whenever you install some dependent libs, they are only valid for this version of language.
  • For example let's say you've installed Go lib with go get, it means it is only usable with current Go version.
  • Some plugins consist of binary files only. Nothing to compile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment