DEV Community

Cover image for Boost Your Ubuntu Dev Workflow with Homebrew and ASDF (Multi-language Version Manager)
Javier Jimenez
Javier Jimenez

Posted on • Edited on

Boost Your Ubuntu Dev Workflow with Homebrew and ASDF (Multi-language Version Manager)

version en español

Official Links


🍺 Homebrew on Ubuntu

Homebrew is a free and open-source command-line package manager designed for macOS (and also Linux, under the name Linuxbrew or Homebrew on Linux). Its main purpose is to simplify the installation and management of software that Apple does not include natively.

  • What is it for? It allows you to install thousands of utilities, development tools (such as Git, Node.js, Python), and other applications with simple commands like brew install <package>. Essentially, it helps developers and advanced users easily get the software they need on their system without having to compile it manually or search for individual installers. It works like an “app store” for your terminal.

📦 Installation

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Add to PATH

echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

# Install basic dependencies

brew install gcc git
Enter fullscreen mode Exit fullscreen mode

🧰 Useful commands

brew install <pkg>
brew uninstall <pkg>
brew list
brew update
brew upgrade
brew search <name>
Enter fullscreen mode Exit fullscreen mode

🚀 ASDF - The Multiple Version Manager

asdf is an extensible and multifunctional version manager for the command line. Unlike other managers that focus on a single language (such as nvm for Node.js or rvm for Ruby), asdf uses a plugin system to manage multiple versions of different programming languages, runtimes, and tools (like Node.js, Python, Ruby, Java, Elixir, etc.) in a centralized way.

  • What is it for? It allows you to easily switch between the tool versions needed for different projects. For example, if one project requires Python 3.8 and another needs Python 3.11, asdf ensures the correct environment is active automatically for each working directory, helping to avoid dependency conflicts and simplify the maintenance of multiple development environments.

📦 Installation

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0

echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc
echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc
source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

🧰 Useful commands

asdf plugin add <lang>
asdf list-all <lang>
asdf install <lang> <version>
asdf global <lang> <version>
asdf local <lang> <version>
asdf uninstall <lang> <version>
Enter fullscreen mode Exit fullscreen mode

Example using Go – Install plugin + version

asdf plugin add golang https://github.com/asdf-community/asdf-golang.git

asdf install golang 1.22.4
asdf global golang 1.22.4
Enter fullscreen mode Exit fullscreen mode

Example .tool-versions file

# .tool-versions
golang 1.22.4
# You can add other tools managed by ASDF
php 8.2.12
nodejs 20.10.0
ruby 3.2.2
Enter fullscreen mode Exit fullscreen mode

Top comments (0)