Skip to content

Instantly share code, notes, and snippets.

@noisemaster
Last active March 13, 2019 14:25
Show Gist options
  • Save noisemaster/4a362d92cf0be3aba443adadf7b46250 to your computer and use it in GitHub Desktop.
Save noisemaster/4a362d92cf0be3aba443adadf7b46250 to your computer and use it in GitHub Desktop.

Installing the latest possible version of Erlang on Windows Subsystem for Linux on the Anniversary Update

wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb # Adds repo to ubuntu
sudo apt-get update
sudo apt-get install esl-erlang=1:18.3 
# installs a version of erlang that plays nice with this verision of WSL
# you might have to remove some packages to install this version, so feel free to uninstall those packages
# you can see these errors in the below code block
sudo rm /usr/bin/erl # This prevents a symlink error that happens when you install this version of erlang
sudo ln -s /usr/lib/erlang/bin/erl /usr/bin/erl # this resymlinks the correct erlang file

What you should get out

This also shows the errors you might get

~ via ⬢ none
➔ wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
--2016-11-16 16:21:58--  https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
Resolving packages.erlang-solutions.com (packages.erlang-solutions.com)... 31.172.186.53
Connecting to packages.erlang-solutions.com (packages.erlang-solutions.com)|31.172.186.53|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4842 (4.7K) [application/x-debian-package]
Saving to: ‘erlang-solutions_1.0_all.deb’

100%[==============================================================================================>] 4,842       --.-K/s   in 0s

2016-11-16 16:21:59 (78.3 MB/s) - ‘erlang-solutions_1.0_all.deb’ saved [4842/4842]

Selecting previously unselected package erlang-solutions.
(Reading database ... 49026 files and directories currently installed.)
Preparing to unpack erlang-solutions_1.0_all.deb ...
Unpacking erlang-solutions (1.0) ...
Setting up erlang-solutions (1.0) ...
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse

~ via ⬢ none
➔  sudo apt-get update
Hit http://security.ubuntu.com trusty-security InRelease
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/restricted amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Ign http://archive.ubuntu.com trusty InRelease
Hit http://ppa.launchpad.net trusty InRelease
Hit http://security.ubuntu.com trusty-security/multiverse amd64 Packages
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/multiverse Translation-en
Hit http://security.ubuntu.com trusty-security/restricted Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Hit http://archive.ubuntu.com trusty-updates InRelease
Ign http://packages.erlang-solutions.com trusty InRelease
Hit http://ppa.launchpad.net trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty Release.gpg
Hit http://packages.erlang-solutions.com trusty Release.gpg
Hit http://ppa.launchpad.net trusty/main Translation-en
Hit http://archive.ubuntu.com trusty-updates/main amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/restricted amd64 Packages
Ign http://binaries.erlang-solutions.com trusty InRelease
Hit http://archive.ubuntu.com trusty-updates/universe amd64 Packages
Hit http://packages.erlang-solutions.com trusty Release
Hit http://archive.ubuntu.com trusty-updates/multiverse amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/main Translation-en
Get:1 http://binaries.erlang-solutions.com trusty Release.gpg [836 B]
Hit http://archive.ubuntu.com trusty-updates/multiverse Translation-en
Hit http://packages.erlang-solutions.com trusty/contrib amd64 Packages
Hit http://archive.ubuntu.com trusty-updates/restricted Translation-en
Hit http://archive.ubuntu.com trusty-updates/universe Translation-en
Hit http://archive.ubuntu.com trusty Release
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Get:2 http://binaries.erlang-solutions.com trusty Release [3,687 B]
Hit http://archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty/universe amd64 Packages
Hit http://archive.ubuntu.com trusty/multiverse amd64 Packages
Hit http://archive.ubuntu.com trusty/main Translation-en
Get:3 http://binaries.erlang-solutions.com trusty/contrib amd64 Packages [69.6 kB]
Hit http://archive.ubuntu.com trusty/multiverse Translation-en
Hit http://archive.ubuntu.com trusty/restricted Translation-en
Hit http://archive.ubuntu.com trusty/universe Translation-en
Ign http://packages.erlang-solutions.com trusty/contrib Translation-en_US
Ign http://archive.ubuntu.com trusty/main Translation-en_US
Ign http://archive.ubuntu.com trusty/multiverse Translation-en_US
Ign http://archive.ubuntu.com trusty/restricted Translation-en_US
Ign http://packages.erlang-solutions.com trusty/contrib Translation-en
Ign http://archive.ubuntu.com trusty/universe Translation-en_US
Ign http://binaries.erlang-solutions.com trusty/contrib Translation-en_US
Ign http://binaries.erlang-solutions.com trusty/contrib Translation-en
Fetched 74.1 kB in 4s (17.8 kB/s)
Reading package lists... Done

~ via ⬢ none
➔ sudo apt-get install esl-erlang=1:18.3
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 esl-erlang : Conflicts: erlang-base-hipe
              Conflicts: erlang-crypto
              Conflicts: erlang-syntax-tools
E: Unable to correct problems, you have held broken packages.

~ via ⬢ v5.12.0
➔ sudo apt remove erlang-base-hipe erlang-crypto erlang-syntax-tools
[sudo] password for noisemaster:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'erlang-base-hipe' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  acl at-spi2-core ca-certificates-java colord dconf-gsettings-backend
  dconf-service desktop-file-utils emacsen-common erlang-base erlang-debugger
  erlang-dev erlang-et erlang-eunit erlang-examples erlang-gs erlang-ic
  erlang-ic-java erlang-inviso erlang-jinterface erlang-mnesia erlang-mode
  erlang-odbc erlang-parsetools erlang-pman erlang-runtime-tools erlang-src
  erlang-toolbar erlang-tv erlang-wx erlang-xmerl fontconfig fontconfig-config
  fonts-dejavu-core fonts-dejavu-extra gconf-service gconf-service-backend
  gconf2 gconf2-common gvfs gvfs-common gvfs-daemons gvfs-libs
  hicolor-icon-theme java-common libasound2 libasound2-data libasyncns0
  libatasmart4 libatk-bridge2.0-0 libatk-wrapper-java libatk-wrapper-java-jni
  libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3
  libavahi-common-data libavahi-common3 libavahi-glib1 libbonobo2-0
  libbonobo2-common libcairo-gobject2 libcairo2 libcanberra0 libcolord1
  libcolorhug1 libcups2 libdatrie1 libdconf1 libdrm-intel1 libdrm-nouveau2
  libdrm-radeon1 libexif12 libflac8 libfontconfig1 libfontenc1 libfreetype6
  libgconf-2-4 libgconf2-4 libgd3 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common
  libgif4 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglu1-mesa
  libgnome2-0 libgnome2-bin libgnome2-common libgnomevfs2-0
  libgnomevfs2-common libgphoto2-6 libgphoto2-l10n libgphoto2-port10
  libgraphite2-3 libgtk-3-0 libgtk-3-bin libgtk-3-common libgtk2.0-0
  libgtk2.0-bin libgtk2.0-common libgudev-1.0-0 libgusb2 libharfbuzz0b
  libice-dev libidl-common libidl0 libieee1284-3 libjasper1 libjbig0
  libjpeg-turbo8 libjpeg8 liblcms2-2 libllvm3.4 libltdl7 libnspr4 libnss3
  libnss3-nssdb libodbc1 libogg0 liborbit-2-0 liborbit2 libpango-1.0-0
  libpangocairo-1.0-0 libpangoft2-1.0-0 libpciaccess0 libpixman-1-0
  libpthread-stubs0-dev libpulse0 libsane libsane-common libsctp1
  libsecret-1-0 libsecret-common libsm-dev libsndfile1 libtcl8.6 libtdb1
  libthai-data libthai0 libtiff5 libtk8.6 libtxc-dxtn-s2tc0 libudisks2-0
  libutempter0 libv4l-0 libv4lconvert0 libvorbis0a libvorbisenc2
  libvorbisfile3 libvpx1 libwayland-client0 libwayland-cursor0 libwxbase2.8-0
  libwxgtk2.8-0 libx11-dev libx11-doc libx11-xcb1 libxau-dev libxaw7
  libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0
  libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb1-dev libxcomposite1
  libxcursor1 libxdamage1 libxdmcp-dev libxfixes3 libxft2 libxi6 libxinerama1
  libxkbcommon0 libxpm4 libxrandr2 libxrender1 libxshmfence1 libxss1 libxt-dev
  libxtst6 libxv1 libxxf86dga1 libxxf86vm1 lksctp-tools openjdk-7-jre
  openjdk-7-jre-headless os-prober policykit-1-gnome sound-theme-freedesktop
  tcl tcl8.6 tk tk8.6 tzdata-java udisks2 x11-utils x11proto-core-dev
  x11proto-input-dev x11proto-kb-dev xbitmaps xorg-sgml-doctools xterm
  xtrans-dev
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  erlang erlang-appmon erlang-asn1 erlang-common-test erlang-corba
  erlang-crypto erlang-dialyzer erlang-diameter erlang-edoc erlang-eldap
  erlang-erl-docgen erlang-inets erlang-megaco erlang-observer erlang-os-mon
  erlang-percept erlang-public-key erlang-reltool erlang-snmp erlang-ssh
  erlang-ssl erlang-syntax-tools erlang-test-server erlang-tools erlang-typer
  erlang-webtool
0 upgraded, 0 newly installed, 26 to remove and 31 not upgraded.
After this operation, 31.1 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 49026 files and directories currently installed.)
Removing erlang (1:19.1-1) ...
Removing erlang-common-test (1:19.1-1) .............................................................................................]
Removing erlang-test-server (1:19.1-1) .............................................................................................]
Removing erlang-observer (1:19.1-1) ................................................................................................]
Removing erlang-appmon (1:19.1-1) ..................................................................................................]
Removing erlang-eldap (1:19.1-1) ...####............................................................................................]
Removing erlang-megaco (1:19.1-1) ...########.......................................................................................]
Removing erlang-corba (1:19.1-1) ...#############...................................................................................]
Removing erlang-reltool (1:19.1-1) ...################..............................................................................]
Removing erlang-tools (1:19.1-1) ...######################..........................................................................]
Removing erlang-erl-docgen (1:19.1-1) ...#####################......................................................................]
Removing erlang-edoc (1:19.1-1) ...################################.................................................................]
Removing erlang-diameter (1:19.1-1) ...################################.............................................................]
Removing erlang-ssh (1:19.1-1) ...#########################################.........................................................]
Removing erlang-typer (1:19.1-1) ...############################################....................................................]
Removing erlang-dialyzer (1:19.1-1) ...#############################################................................................]
Removing erlang-os-mon (1:19.1-1) ...####################################################...........................................]
Removing erlang-percept (1:19.1-1) ...#######################################################.......................................]
Removing erlang-snmp (1:19.1-1) ...##############################################################...................................]
Removing erlang-webtool (1:19.1-1) ...################################################################..............................]
Removing erlang-inets (1:19.1-1) ...######################################################################..........................]
Removing erlang-ssl (1:19.1-1) ...#############################################################################.....................]
Removing erlang-public-key (1:19.1-1) ...##########################################################################.................]
Removing erlang-asn1 (1:19.1-1) ...####################################################################################.............]
Removing erlang-crypto (1:19.1-1) ...#######################################################################################........]
Removing erlang-syntax-tools (1:19.1-1) ...#####################################################################################....]
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...###############################################################################]

~ via ⬢ v5.12.0
➔ sudo apt-get install esl-erlang=1:18.3
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  erlang-jinterface libglu1-mesa libice-dev libodbc1 libpthread-stubs0-dev
  libsm-dev libtcl8.6 libtk8.6 libutempter0 libx11-dev libx11-doc libxau-dev
  libxcb1-dev libxdmcp-dev libxss1 libxt-dev os-prober tcl tcl8.6 tk tk8.6
  x11proto-core-dev x11proto-input-dev x11proto-kb-dev xbitmaps
  xorg-sgml-doctools xterm xtrans-dev
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  erlang-base erlang-debugger erlang-dev erlang-et erlang-eunit
  erlang-examples erlang-gs erlang-ic erlang-ic-java erlang-inviso
  erlang-mnesia erlang-odbc erlang-parsetools erlang-pman erlang-runtime-tools
  erlang-src erlang-toolbar erlang-tv erlang-wx erlang-xmerl
The following NEW packages will be installed:
  esl-erlang
0 upgraded, 1 newly installed, 20 to remove and 31 not upgraded.
Need to get 39.9 MB of archives.
After this operation, 84.8 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Get:1 http://packages.erlang-solutions.com/ubuntu/ trusty/contrib esl-erlang amd64 1:18.3 [39.9 MB]
Fetched 39.9 MB in 4min 28s (149 kB/s)
(Reading database ... 47571 files and directories currently installed.)
Removing erlang-src (1:19.1-1) ...
Removing erlang-examples (1:19.1-1) ...
Removing erlang-debugger (1:19.1-1) ...
Removing erlang-dev (1:19.1-1) ...
Removing erlang-et (1:19.1-1) ...
Removing erlang-eunit (1:19.1-1) ...
Removing erlang-toolbar (1:19.1-1) ...
Removing erlang-tv (1:19.1-1) ...
Removing erlang-ic-java (1:19.1-1) ...
Removing erlang-ic (1:19.1-1) ...
Removing erlang-inviso (1:19.1-1) ...
Removing erlang-runtime-tools (1:19.1-1) ...
Removing erlang-mnesia (1:19.1-1) ...
Removing erlang-odbc (1:19.1-1) ...
Removing erlang-parsetools (1:19.1-1) ...
Removing erlang-pman (1:19.1-1) ...
Removing erlang-wx (1:19.1-1) ...
Removing erlang-xmerl (1:19.1-1) ...
Removing erlang-gs (1:19.1-1) ...
Removing erlang-base (1:19.1-1) ...
Searching for services which depend on erlang and should be stopped...none found.
Killing epmd...it is not running.
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Selecting previously unselected package esl-erlang.
(Reading database ... 43196 files and directories currently installed.)
Preparing to unpack .../esl-erlang_1%3a18.3_amd64.deb ...
Unpacking esl-erlang (1:18.3) ...
Setting up esl-erlang (1:18.3) ...

~ via ⬢ v5.12.0
➔ erl
zsh: is a directory: erl

~ via ⬢ v5.12.0
➔ sudo rm /usr/bin/erl

~ via ⬢ v5.12.0
➔ sudo ln -s /usr/lib/erlang/bin/erl /usr/bin/erl

~ via ⬢ v5.12.0
➔ erl
Erlang/OTP 18 [erts-7.3] [source-d2a6d81] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V7.3  (abort with ^G)
@Angeluz-07
Copy link

Angeluz-07 commented Mar 9, 2019

The line sudo apt remove erlang-base-hipe erlang-crypto erlang-syntax-tools helped me to be able to run sudo apt-get install esl-erlang while installing elixir in ubuntu 18

@martinlevesque
Copy link

martinlevesque commented Mar 13, 2019

Same, apt remove fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment