Installing library in /usr/local/lib/ghc-8.10.2/ghc-8.10.2
"/usr/local/lib/ghc-8.10.2/bin/ghc-pkg" --force --global-package-db "/usr/local/lib/ghc-8.10.2/package.conf.d" update rts/dist/package.conf.install
/usr/local/lib/ghc-8.10.2/bin/ghc-pkg: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
ghc.mk:967: recipe for target 'install_packages' failed
make[1]: *** [install_packages] Error 127
there is a topic with a similar issue but libtinfo.so.5 is installed on my system.
So what I did as a workaround is to make a symlink to version 5: ln -s /lib/aarch64-linux-gnu/libtinfo.so.5.9 /lib/aarch64-linux-gnu/libtinfo.so.6
But then I got this error:
Installing library in /usr/local/lib/ghc-8.10.2/ghc-8.10.2
"/usr/local/lib/ghc-8.10.2/bin/ghc-pkg" --force --global-package-db "/usr/local/lib/ghc-8.10.2/package.conf.d" update rts/dist/package.conf.install
/usr/local/lib/ghc-8.10.2/bin/ghc-pkg: /lib/aarch64-linux-gnu/libtinfo.so.6: version `NCURSES6_TINFO_5.0.19991023' not found (required by /usr/local/lib/ghc-8.10.2/bin/ghc-pkg)
/usr/local/lib/ghc-8.10.2/bin/ghc-pkg: /lib/aarch64-linux-gnu/libtinfo.so.6: version `NCURSES6_TINFO_5.0.19991023' not found (required by /usr/local/lib/ghc-8.10.2/bin/../terminfo-0.4.1.4/libHSterminfo-0.4.1.4-ghc8.10.2.so)
ghc.mk:967: recipe for target 'install_packages' failed
make[1]: *** [install_packages] Error 1
Makefile:51: recipe for target 'install' failed
make: *** [install] Error 2
Any ideas what went worng? Thanks!
uname -a
Linux d17578762118 4.15.0-143-generic #147-Ubuntu SMP Wed Apr 14 16:10:11 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
cat /etc/issue
Ubuntu 18.04.5 LTS \n \l
Hello, it appears the ghc version you are currently trying to use has been linked again libtinfo6, you should consider installing the required dependency. libtinfo5 and libtinfo6 are different libraries, I mean same project but not version.
As for the second error, it is to be expected, a symlink to libtinfo5 will not make a libtinfo6 out of it. I mean you’ll only fool the dynamic linker up to the point when it is looking for a symbol in your lib that is not present (see ld.so(8) for more information). If you want to check the symbols in a shared object (dynamic library) then you could use nm -D mylib.so.
Since you’re using Ubuntu, maybe
$ sudo apt-get install libtinfo6
will resolve your issue, you can have libtinfo5 and libtinfo6 living in harmony on the same system without any trouble. And if you want to check which of your packages are relying on libtinfo5, then
Well, that’s unfortunate, I see another solution if you want to keep this Long Term Support install (16.04 is already in Extended Security Maintenance phase though), however be advised that you might run into other outdated libs. First you would have to get the corresponding libtinfo6 package, then either you install it manually (dpkg -i libtinfo6_6.2-0ubuntu2_amd64.deb for amd64 arch), since this package does only have one dependency on libc6, or you extract the required lib (.so and symlinks) with the help of dpkg-deb tool (dpkg package on Debian, probably the same on Ubuntu). Then don’t forget to run ldconfig.
Content of libtinfo6_6.2-0ubuntu2_amd64.deb package
And remember this solution is more of a workaround than a fix because if you go this way you will not get the benefits of the package manager, you’ll have to do it again if libtinfo6 has an update.