Stack: error while loading shared libraries: libtinfo.so.5

Created on 19 Sep 2015  路  15Comments  路  Source: commercialhaskell/stack

So, today a system update of my Arch Linux box ended in tears as stack is now giving me this error whenever I try to build anything.

$ stack build
Running /home/oldmanmike/.stack/programs/x86_64-linux/ghc-7.10.2/bin/ghc --numeric-version exited with ExitFailure 127
/home/oldmanmike/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc-7.10.2/bin/ghc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

But I have libtinfo.so.5...

$ ls -l /usr/lib | grep libtinfo
lrwxrwxrwx 1 root root       22 Sep 18 20:58 libtinfo.so -> /usr/lib/libtinfo.so.5

I've been able to reproduce this on two separate systems today, both running Arch Linux.

$ stack build --verbose
Version 0.1.3.1, Git revision 154fd25a9b231ca178ad3401aaec00c6b608e5db (1712 commits) X86_64
2015-09-19 01:40:58.129048: [debug] Checking for project config at: /home/oldmanmike/src/github.com/oldmanmike/catan/stack.yaml @(stack_H7Fzr4XhLQ9FcjplPK0nQq:Stack.Config src/Stack/Config.hs:466:9)
2015-09-19 01:40:58.129166: [debug] Loading project config file stack.yaml @(stack_H7Fzr4XhLQ9FcjplPK0nQq:Stack.Config src/Stack/Config.hs:489:13)
2015-09-19 01:40:58.129532: [debug] Trying to decode /home/oldmanmike/.stack/build-plan-cache/x86_64-linux/nightly-2015-09-17.cache @(stack_H7Fzr4XhLQ9FcjplPK0nQq:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:77:5)
2015-09-19 01:40:58.133896: [debug] Success decoding /home/oldmanmike/.stack/build-plan-cache/x86_64-linux/nightly-2015-09-17.cache @(stack_H7Fzr4XhLQ9FcjplPK0nQq:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:86:13)
2015-09-19 01:40:58.134341: [debug] Run process: ghc --info @(stack_H7Fzr4XhLQ9FcjplPK0nQq:System.Process.Read src/System/Process/Read.hs:260:3)
2015-09-19 01:40:58.159464: [debug] Run process: ghc --numeric-version @(stack_H7Fzr4XhLQ9FcjplPK0nQq:System.Process.Read src/System/Process/Read.hs:260:3)
Running /home/oldmanmike/.stack/programs/x86_64-linux/ghc-7.10.2/bin/ghc --numeric-version exited with ExitFailure 127
/home/oldmanmike/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc-7.10.2/bin/ghc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

Most helpful comment

For ArchLinux users:
Installing ncurses5-compat-libs from the aur is another solution.

All 15 comments

You may have the a symlink libtinfo.so, but it doesn't appear to be pointing to an existing file (your ls ... |grep libtinfo command would have shown the destination file as another line if it had existed).

I don't have any idea why your libtinfo.so.5 disappeared, though.

Found this issue, but I've already installed the package the solution involves. It doesn't seem to work. It's also flagged out of date.

The PKGBUILD provided by the package (right now) is broken. The maintainer has been provided a working PKGBUILD but just hasn't updated the package yet for some reason. I used the linked PKGBUILD to manually build from source and it worked. I also switched off of haskell-stack-git to haskell-stack, but I doubt that makes a difference for this issue.

Thanks. I was having a similar issue

Hello, I had an issue with libtinfo.so as well when doing stack install ghc-mod in my project.
The installation failed because it didn't find libtinfo.so on my system (ubuntu)
I resolved the issue by manually creating the symlink which didn't exist :
locate libtinfo.so
sudo ln -s /path/to/libtinfo.so.5 /path/to/libtinfo.so :+1:

Hit this upgrading from Fedora 23 to Fedora 24. Fix at as per @emmanueltouzery 's suggestion at https://github.com/commercialhaskell/stack/issues/2300#issuecomment-228412509 to install ncurses-compat-libs (on Fedora) worked.

AfC

Hit at the same problem while trying to run Cling on Fedora 24. Fixed it by installing ncurses-compat-libs on Fedora 24 just as suggested by @emmanueltouzery / @afcowie.

For ArchLinux users:

I had this problem on my VM and I solved by installing the libtinfo package from AUR and then creating a symbolic link to /usr/lib/libtinfo.so:

sudo ln -s /usr/lib/libtinfo.so /usr/lib/libtinfo.so.5

For ArchLinux users:
Installing ncurses5-compat-libs from the aur is another solution.

Download source from https://ftp.gnu.org/gnu/ncurses/
./configure --prefix= --with-termlib --with-shared
make
make install

cd /lib 
sudo ln -s libncurses.so libtinfo.so.5

Solved it for me on Void Linux, GHC 8.2.2 64

Recently noticed this issue popping up out of nowhere. My solution was to create a symbolic link between libtinfo.so.6 as libtinfo.so.5. Hope this helps someone else.

sudo ln -s /usr/lib/libtinfo.so.6 /usr/lib/libtinfo.so.5

Ran into this issue on Fedora 27. Following @DougBeney's lead, I was able to workaround it by creating this symlink:

sudo ln -s /usr/lib64/libtinfo.so.6 /usr/lib64/libtinfo.so

On Arch Linux everything is already installed with the core packages.
Because core package ncurses provides everything you require : https://www.archlinux.org/packages/core/x86_64/ncurses/

Just create a symlink to libncursesw.so.6 with : sudo ln -sf /usr/lib/libncursesw.so.6 /usr/lib/libtinfo.so.5.
No need to install anything from the AUR.

EDIT: When you expand the Package Contents link on the ncurses package page, you will notice usr/lib/libtinfo.so.6, which also is a symlink to /usr/lib/libncursesw.so.6.

even, i created symlink, then also i got the same error!!!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bitemyapp picture bitemyapp  路  3Comments

srghma picture srghma  路  3Comments

abhinav picture abhinav  路  4Comments

s5k6 picture s5k6  路  3Comments

jwaldmann picture jwaldmann  路  4Comments