[Development] Multi-version management command line tool asdf-vm installation and use

asdf-vmTool introduction

asdf-vm is a command line tool that can manage multiple language runtime versions according to projects. Currently, it supports 150+ languages ​​or common development tools in the form of plug-ins.

asdf-vmproject address

Project source code address

asdf-vmUse document address

Document address

Installation asdf-vmtool

Environmental description

System: deepin V20
Platform:amd64

Dependent tool installation

sudo apt install curl git

installation

# 国内镜像
git clone https://gitee.com/winnochan/asdf.git ~/.asdf
# 切换到国外镜像
cd ~/.asdf
vim .git/config
# 修改url地址,将https://gitee.com/winnochan/asdf.git改成https://github.com/asdf-vm/asdf.git
# 然后更新项目
git pull
# 切换最新分支
git checkout "$(git describe --abbrev=0 --tags)"
# 配置环境变量
vim ~/.bashrc
# 在.bashrc文件中添加以下代码
. $HOME/.asdf/asdf.sh

Common method

Manage plugins

  1. Install plugin
asdf plugin add <name>
# asdf plugin add erlang
  1. View installed plugins
asdf plugin list
# asdf plugin list
# java
# nodejs
  1. Update plugin
asdf plugin update --all # 更新全部插件

asdf plugin update <name>  # 更新指定插件
# asdf plugin update erlang
  1. Remove plugin
asdf plugin remove <name>
# asdf plugin remove erlang

Management version

  1. Install the specified version
asdf install <name> <version>
# asdf install erlang 17.3
  1. Install the latest stable version
asdf install <name> latest
# asdf install erlang latest

# 指定大版本的最新稳定版本
asdf install <name> latest:<version>
# asdf install erlang latest:17
  1. View installed version
asdf list <name>
# asdf list erlang
  1. View all installed versions
asdf list all <name>
# asdf list all erlang

# 其他方式
asdf list all <name> <version>
# asdf list all erlang 17
  1. Check the latest stable version
asdf latest <name>
# asdf latest erlang

# 其他方式
asdf latest <name> <version>
# asdf latest erlang 17
  1. Set current version
asdf global <name> <version> [<version>...]
asdf shell <name> <version> [<version>...]
asdf local <name> <version> [<version>...]
# asdf global elixir 1.2.4
  1. Show current version
asdf current
# asdf current
# erlang 17.3 (set by /Users/kim/.tool-versions)
# nodejs 6.11.5 (set by /Users/kim/cool-node-project/.tool-versions)

asdf current <name>
# asdf current erlang
# 17.3 (set by /Users/kim/.tool-versions)
  1. Uninstall the specified version
asdf uninstall <name> <version>
# asdf uninstall erlang 17.3

Guess you like

Origin blog.csdn.net/macaiyun0629/article/details/108737173