Fixing ncurses5 to ncurses6 Dependency Issues on Arch Linux

This post is alternatively titled: “How to resolve error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory”.

While attempting to do a recent system update, I ran into two problems:

  1. pacman was not downloading any packages due to an out-of-date gnupg package.
  2. Trying to install the gnupg package manually resulted in the alternative title of this post.

All of this was because I decided to run sudo pacman -S libncurses in order to get my conky working properly. Turns out a lot more programs rely on libncurses than I previously realized.

The problem gave me more of a headache than thought it would, but I eventually solved the issue. Here’s how:

  1. Since I recently upgraded libncurses through pacman from version 5 to version 6, the old version was still saved in the cache in /var/cache/pacman/pkg
  2. I extracted the cached version of libncurses by using sudo mkdir tempNcurses && sudo tar -xvf ncurses-5.9-7-x86_64.pkg.tar.xz -C tempNcurses
  3. I then copied the resulting binary into the libraries folder with sudo cp tempNcurses/libncursesw.so.5.9 /usr/lib
  4. I then made a symbolic link with the file specified in the error messages with sudo ln -s /usr/lib/libncursesw.so.5.9 /usr/lib/libncursesw.so.5

After this, everything worked as expected! I was able to manually update GnuPG and then update everything else that had a dependence on ncurses

3 thoughts on “Fixing ncurses5 to ncurses6 Dependency Issues on Arch Linux

  1. Newba

    Thanks man.. Helped me a lot. I was trying to install the AUR lib32-ncurses5-compat-libs but it required to remove the version 6 and I already had several packages depending on it. In this way I could solve the problem easily.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *