Sunday, April 17, 2016

3 Steps to fixing "ldconfig empty, not checked" due to corrupted pkgs.

Worked this out today, figured I'd toss it on the blog for fun and hopefully to help others.

 1) Get the initial list of empty libs from pacman
cat /var/log/pacman.log | grep --text empty | awk '{print $6}' | sort -u >> /tmp/liblist
2) Determine which packages they belong to so you know which need to be re-installed
for X in $(cat /tmp/liblist); do pkgfile -s $X;done | sort -u >> /tmp/pkglist
3) Force reinstall the packages
sudo pacman -Syyy && for X in $(cat /tmp/pkglist); do sudo pacman -S --noconfirm --force $X; done
Be sure to understand these commands and what they are doing, don't just blindly run commands you find on the web. In my case these all worked out perfectly for me, they should in most cases. If something bad should come of you running these commands, I am not liable. :-P