A partial update / install results in pacman: error while loading shared libraries: cannot open shared object file: No such file or directory .


Packages which rely on libraries may cease to function if the inital package is not updated alongside the library package (in this case libidn upgraded to libidn2). For example, installing wget with pacman -Sy resulted in:

* Updating the package index
* Downloading and installing the latest wget
* Updating and installing the lastest libidn library package

In this case all packages that relied on libidn cease to work (including pacman) as the library has been updated to libisn2 outside of updating all packages that depend upon it.

Do not install packages with pacman -Sy. Install only the package with pacman -S, or completely update all packages and install the required package with pacman -Syu. (Partial upgrades are not supported on Arch)


A quick and dirty way to fix (confirmed tested on my machine):

* Copy the old libidn cached package to a tmp directory : mkdir ~/tmp && sudo cp /var/cache/pacman/pkg/libidn2-2.1.0-1-x86_64.pkg.tar.xz ~/tmp/
* Extract the package : sudo tar xvf libidn2-2.1.0-1-x86_64.pkg.tar.xz
* Temporarily symlink the in place : sudo ln -s "$(pwd)/usr/lib/" /usr/lib/
* Update all packages : sudo pacman -Syyu
* Remove the symlink : sudo rm /usr/lib/