Getting rid of the /lib symlink on Gentoo

The /lib and /usr/lib symlink on Gentoo I find quite annoying. These just let software make assumptions about whether they should use /usr/lib or /usr/lib64, and I personally prefer if things break so they can be fixed. I wanted to follow what RedHat (and Fedora) are doing, which is, 32-bit stuff goes in lib and 64-bit in lib64. Luckily, Gentoo was also headed this way. So, here is what I did.



First I prepare a custom profile. This profile inherits these two:




  • default/linux/amd64/13.0/desktop/gnome/systemd, which I normally use

  • features/multilib



In the custom profile I add make.defaults with the single line SYMLINK_LIB="no".



Get rid of the lib symlink, but do it carefully.



First copy everything from lib64 to lib (well, I just opted for hard linking everything):



sudo rsync -avPAH --link-dest /lib64/{,} /lib.new/
sudo rsync -avPAH --link-dest /usr/lib64/{,} /usr/lib.new/
sudo bash -x -c 'rm -v /lib && mv /lib.new /lib'
sudo bash -x -c 'rm -v /usr/lib && mv /usr/lib.new /usr/lib'


Now it's time to reinstall everything. You probably can go with things that install files in lib or lib64, but I preferred to go for everything.

Comments

Popular posts from this blog

Installing Gentoo with full disk encryption

ADSL Router Model CT-5367 user and pass (VIVACOM)

FreeIPA cluster with containers