Search code examples
ubuntuerlangusb

Can't install Erlang/OTP 26 from source on Ubuntu 20.04


Environment:

  • OS Ubuntu, 20.04.

Installing Erlang from source ./configure && make && make install

./configure --disable-option-checking --cache-file=/dev/null --srcdir="/home/user/Documents/_installed/otp_src_26.1/erts"
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
checking for clang... no
configure: error: in `/home/user/Documents/_installed/otp_src_26.1/erts':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
ERROR: /home/user/Documents/_installed/otp_src_26.1/erts/configure failed!
Killed

In order to install it I have to do (and I did it) those steps:

1. sudo apt-get update

Hit:1 http://ua.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done

2. sudo apt-get upgrade

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

3. sudo apt-get install build-essential

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:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
                   Depends: g++ (>= 4:9.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Solution

  • [Solved]

    1. To solve no acceptable C compiler found in $PATH: sudo apt install gcc.
    2. Downgrade your libc6: sudo apt install libc6=2.31-0ubuntu9.7.
    3. Now, you're ready to execute: sudo apt install build-essential.
    4. If everything is fine execute: ./configure && make && make install.