Error while loading libtinfo.so.6

Hi everybody, i'm trying to install swift on my linux os but i have this error when i try to run something like "swift --version"

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

Do you know how can i solve? :pensive:

I did this on Fedora 33 Linux:

$ sudo dnf install swift-lang
1 Like

I have a son of Debian so i tried sudo apt install swift-lang but i have this error E: Unable to locate package swift-lang so i don't know how can i solve... :-/

The list of dependencies for Ubuntu are listed at Swift.org - Download Swift. In particular, installing libedit2 should include the dependency libtinfo5, which is what you're seeing the error about.

1 Like

Hi thanks for reply, i have installed it correctly libedit2 is already the newest version (3.1-20170329-1). and libtinfo5 is already the newest version (6.1-1ubuntu1.18.04). but when i try to follow your linked guide at the end i have the same problem, so swift: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory
I really don't know how can i solve :-/

However i'm trying do download the last version of swift (5...) that is really new and i thing that some libraries isn't updated... for you can be a solution install an old version?

I would like to specify that I have ElementaryOS that is a son of Ubuntu

Are you using the Ubuntu 18.04 build of Swift?

Nope i'm using Ubuntu 20.04, i must try using Ubuntu 18.04?

I SOLVED USING THIS GUIDE

http://swift-linux.refi64.com/en/latest/others.html

I have followed the steps but still getting the same issue

swift: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory

My Configuration: Ubuntu22.04.3 (WSL2)