Install Erlang in Headless Mode
This post is for Ubuntu, in other distros it may be different and will vary according to the package manager.
Following the instructions from the Elixir installation guide on my development server I see it tries to install a lot of packages including a desktop environment:
❯ sudo apt install esl-erlang elixir
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
acl adwaita-icon-theme apg aptdaemon aptdaemon-data ... x11-xserver-utils xdg-dbus-proxy xml-core xserver-xephyr xserver-xorg xserver-xorg-input-all xserver-xorg-input-libinput
xserver-xorg-input-wacom xserver-xorg-legacy xserver-xorg-video-all xserver-xorg-video-amdgpu xserver-xorg-video-ati xserver-xorg-video-fbdev xserver-xorg-video-intel
xserver-xorg-video-nouveau xserver-xorg-video-qxl xserver-xorg-video-radeon xserver-xorg-video-vesa
0 upgraded, 347 newly installed, 0 to remove and 4 not upgraded.
Need to get 154 MB of archives.
This is certainly not something I want, I don’t need xserver neither any of its dependencies thus the best we can do is to run it like
❯ sudo apt install esl-erlang elixir --no-install-recommends
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
adwaita-icon-theme elixir esl-erlang gtk-update-icon-cache hicolor-icon-theme humanity-icon-theme libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libcolord2 libgtk-3-0
libgtk-3-common liblcms2-2 libncurses5 libnotify4 librest-0.7-0 libsoup-gnome2.4-1 libtinfo5 libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 libxcomposite1 libxdamage1 ubuntu-mono
0 upgraded, 24 newly installed, 0 to remove and 4 not upgraded.
Need to get 58.7 MB of archives.
That looks way better, since now it won’t force me to install a complete desktop environment.
In short run
sudo apt install esl-erlang elixir --no-install-recommends
and things should be good, unless you really need the functionality provided by those packages.