Mix local.hex not working

Just finished configuring elixir and phoenix on my machine running Linux Mint 20.2 and getting the following error when I try to running the mix local.hex

14:29:18.003 [error] Unable to load crypto library. Failed with error:
":load_failed, Failed to load NIF library /usr/lib/erlang/lib/crypto-5.0.2/priv/lib/crypto: 'libcrypto.so.1.0.0: cannot open shared object file: No such file or directory'"
OpenSSL might not be installed on this system.

** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {'repo.hex.pm', 443}}, {:inet, [:inet], {:eoptions, {:undef, [{:crypto, :supports, [], []}, {:tls_record, :sufficient_support, 1, [file: 'tls_record.erl', line: 762]}, {:tls_record, :supported_protocol_versions, 1, [file: 'tls_record.erl', line: 386]}, {:tls_record, :supported_protocol_versions, 0, [file: 'tls_record.erl', line: 374]}, {:ssl, :handle_option, 4, [file: 'ssl.erl', line: 1870]}, {:ssl, :process_options, 3, [file: 'ssl.erl', line: 1568]}, {:ssl, :handle_options, 5, [file: 'ssl.erl', line: 1521]}, {:ssl, :connect, 4, [file: 'ssl.erl', line: 603]}]}}}]}

Could not install Hex because Mix could not download metadata at https://repo.hex.pm/installs/hex-1.x.csv.

Alternatively, you can compile and install Hex directly with this command:

    mix archive.install github hexpm/hex branch latest

How can I solve this error

If you already have openssl installed, try to uninstall and install erlang again.

1 Like

If you are using a package manager, you might want to try installing with asdf instead.