asdf
An extensible Version Manager.
Install via GitHub-hosted binary
[source]
$ ASDF_VERSION=0.20.0
$ curl -OL https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-amd64.tar.gz
$ curl -OL https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-amd64.tar.gz.md5
# the output of md5sum and the contents of the md5 file should match.
$ md5sum asdf-v${ASDF_VERSION}-linux-amd64.tar.gz.md5
$ tar zxvf asdf-v${ASDF_VERSION}-linux-amd64.tar.gz
$ mv asdf ~/.local/bin/
Then, set configuration in ~/.bashrc.
# ~/.bashrc
$ export PATH="$HOME/.local/bin:$PATH"
$ export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
$ . <(asdf completion bash)
Test your installation.
$ which asdf
$ asdf -v
Add plugins for languages, tools, and install
$ asdf plugin add nodejs
$ asdf install nodejs latest
$ asdf global nodejs latest
$ node --version
Read how to
set the current version
of a language with asdf.
# fall-back to .nvmrc, .ruby-version, et al. when .tool-versions is not present
echo 'legacy_version_file = yes' > ~/.asdfrc