Erlang error: while loading shared libraries: libncursesw.so.6

10,141

I think you need to also install the libncursesw5 package:

sudo apt install libncursesw5 libncursesw5-dev

Then try running the command that gave you the "error while loading shared libraries".

Update: If you have these packages and still get the error, it's probably because your software expects version 6 of libncursesw, but only version 5 is available in Ubuntu. (see https://bbs.archlinux.org/viewtopic.php?id=202562 , which is the same problem, but on Arch Linux.)

As a hackish possible workaround, you could create a symlink so your software thinks version 6 is installed, even though it's actually using verison 5:

sudo ln -s /lib/x86_64-linux-gnu/libncursesw.so.5  /lib/x86_64-linux-gnu/libncursesw.so.6

It's not the most elegant solution, but it might work. If you choose to do it, please remember to document it somewhere just in case you run into any problems when upgrading Ubuntu later on.

Please let me know if this was helpful or if you have further questions.

Share:
10,141

Related videos on Youtube

Oskar K.
Author by

Oskar K.

Updated on September 18, 2022

Comments

  • Oskar K.
    Oskar K. over 1 year

    After installing Elrang/OTP on a server with Ubuntu 15.10,

      sudo apt-get install build-essential 
      sudo apt-get --fix-missing -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk
      sudo apt-get --fix-missing -y install build-essential m4 libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwxgtk2.8-dev libglu1-mesa-dev fop xsltproc default-jdk
      wget https://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_18.3-1~ubuntu~wily_amd64.deb
      sudo dpkg -i esl-erlang_18.3-1~ubuntu~wily_amd64.deb
      sudo apt-get update
    
      sudo apt-get install esl-erlang
      sudo apt-get install elixir
    

    I have an error when running one of my applications:

    : error while loading shared libraries: libncursesw.so.6: cannot open shared object file: No such file or directory
    

    UPDATE:

    $ locate libncursesw5
    /usr/share/doc/libncursesw5
    /var/lib/dpkg/info/libncursesw5:amd64.list
    /var/lib/dpkg/info/libncursesw5:amd64.md5sums
    /var/lib/dpkg/info/libncursesw5:amd64.postinst
    /var/lib/dpkg/info/libncursesw5:amd64.postrm
    /var/lib/dpkg/info/libncursesw5:amd64.shlibs
    /var/lib/dpkg/info/libncursesw5:amd64.symbols
    
    
    $ locate libncursesw
    /lib/x86_64-linux-gnu/libncursesw.so.5
    /lib/x86_64-linux-gnu/libncursesw.so.5.9
    /usr/share/doc/libncursesw5
    /var/lib/dpkg/info/libncursesw5:amd64.list
    /var/lib/dpkg/info/libncursesw5:amd64.md5sums
    /var/lib/dpkg/info/libncursesw5:amd64.postinst
    /var/lib/dpkg/info/libncursesw5:amd64.postrm
    /var/lib/dpkg/info/libncursesw5:amd64.shlibs
    /var/lib/dpkg/info/libncursesw5:amd64.symbols
    
  • Oskar K.
    Oskar K. almost 8 years
    E: Unable to locate package linbcursesw5
  • Admin
    Admin almost 8 years
    Please double-check the spelling of libncursesw5 and try again.
  • Oskar K.
    Oskar K. almost 8 years
    libncursesw5 is already the newest version.
  • Admin
    Admin almost 8 years
    and libncursesw5-dev as well?
  • Oskar K.
    Oskar K. almost 8 years
    ................yes.
  • Admin
    Admin almost 8 years
    I don't know of any elegant solution, but I've updated my answer with a possible workaround.
  • Oskar K.
    Oskar K. almost 8 years
    but neither /usr/lib/libncursesw.so.5 no /usr/lib/libncursesw.so.6 exist at my server.
  • Admin
    Admin almost 8 years
    My mistake! I've updated the paths in my answer.
  • Oskar K.
    Oskar K. almost 8 years
    should it be /lib/x86_64-linux-gnu/libncursesw.so.5 or /lib/x86_64-linux-gnu/libncursesw.so.5.9 ?
  • Vik
    Vik about 5 years
    The hackish symlink solution worked for me. Was having this issue when installing cava (github.com/karlstav/cava).