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:
pacman
was not downloading any packages due to an out-of-date gnupg package.- 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:
- Since I recently upgraded
libncurses
throughpacman
from version 5 to version 6, the old version was still saved in the cache in/var/cache/pacman/pkg
- I extracted the cached version of
libncurses
by usingsudo mkdir tempNcurses && sudo tar -xvf ncurses-5.9-7-x86_64.pkg.tar.xz -C tempNcurses
- I then copied the resulting binary into the libraries folder with
sudo cp tempNcurses/libncursesw.so.5.9 /usr/lib
- 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