Installing Python Ruby and Flutter on Ubuntu Using ASDF
As a developer, I’ve had my fair share of struggles when it comes to building development environments. One of the most frustrating experiences is trying to get multiple versions of programming languages installed on a single system. This is where ASDF (Another Setup Distribution Framework) comes in - a tool that allows you to manage multiple versions of programming languages on your system.
Unfortunately, getting ASDF up and running can be a bit of a chore. I’ve had to spend countless hours scouring the internet for instructions, only to find out that the information is outdated or incomplete. This is why I’m writing this guide - to help others who may be facing similar struggles.
Getting Started with ASDF
To get started with ASDF, you’ll need to download the latest binary from the official release page: https://github.com/asdf-vm/asdf/releases. For this guide, we’ll be using the latest version (0.18.0) at the time of writing.
Once you’ve downloaded the binary, follow these steps:
Step 1: Add ASDF to your path
Add the ASDF binary to your system’s PATH by running:
sudo mv asdf /usr/local/bin/asdf
Then, add the following line to your ~/.zshrc file:
export PATH=PATH:HOME/.local/bin
This will allow you to run ASDF commands from anywhere on your system.
Installing Python with ASDF
To install Python 2 and 3, you’ll need the following packages:
- build-essential (for building packages)
- libncurses5-dev (for curses module)
- libssl-dev (for ssl module)
- zlib1g-dev (for zlib module)
- tk8.6-dev (for Tkinter GUI library)
- libtcl8.6 (for Tcl/Tk library)
- libffi-dev (for ffi module)
- libexpat1-dev (for expat XML parser)
- libbz2-dev (for bz2 compression)
- libreadline-dev (for readline suppor)
- libsqlite3-dev (for sqlite3 database)
Run the following command to install these packages:
sudo apt-get update && sudo apt-get install build-essential libncurses5-dev libssl-dev zlib1g-dev tk8.6-dev libtcl8.6 libffi-dev libexpat1-dev libbz2-dev libreadline-dev libsqlite3-dev
Then, run the following command to install Python 2 and 3:
asdf plugin add python https://github.com/asdf-vm/asdf-python.git
asdf install python 2.7.18
asdf install python 3.13.7
This will download and install Python 2.7 and Python 3.13, the latest non-development versions
Installing Ruby with ASDF
To install Ruby, you’ll need the following packages:
- build-essential (for building packages)
- libreadline-dev (for readline library)
- libgdbm-dev (for gdbm database library)
- libncurses5-dev (for curses module)
- libyaml-dev (for yaml data support, and psych requires this)
Run the following command to install these packages:
sudo apt-get update && sudo apt-get install build-essential libreadline-dev libgdbm-dev libncurses-dev libyaml-dev
Then, install the actual ruby runtime:
asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
asdf install ruby 3.4.5
This will download and install Ruby 3.4.5, again the latest non-development version.
Installing Flutter using ASDF
Step 4: Install Flutter Requirements
To install Flutter, you’ll need the following packages:
- build-essential (for building packages)
- libglu1-mesa-dev (for OpenGL library)
- curl
- git
- unzip
- xz-utils
- zip
Desktop Support:
- clang
- cmake
- git
- ninja-build
- pkg-config
- libgtk-3-dev
- liblzma-dev
- libstdc++-12-dev
Run the following command to install these packages:
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa clang cmake git ninja-build pkg-config libgtk-3.dev liblzma-dev libstdc++-12-dev
Then we can install the current, latest version of flutter.
asdf install flutter 3.35.3-stable
Conclusion
In conclusion, getting ASDF up and running can be a bit of a challenge, but with this guide, you should now have Python 2, 3, Ruby, and Flutter installed on your Ubuntu system using ASDF without wondering what libraries are requried to make it work multiple times. I hope this guide has saved you some time and frustration - happy coding!