I do pretty much that using GNU Stow. Of course I then build packages and libraries on my own, in my $HOME, because I don't have root access on that machine.
I install any PACKAGE of version VERSION in:
~/stow/pkgs/PACKAGE/VERSION/
So taking nim for example, I'd have:
~/stow/pkgs/nim/0.17.1/
Under that, I'd have the whole FHS system for just nim 0.17.1:
I set ~/stowed/ as my STOW_TARGET. So on running stow, symlinks to all:
~/stow/pkgs/PACKAGE/VERSION/{bin,lib,share,..}/..
get created in:
~/stowed/{bin,lib,share,..}/..
I then have aliases set up to do something like "unstow PKG/OLD_VER" and "restow PKG/NEW_VER" when I want to change the package version.
I skip the "restow" step if I just want to "soft uninstall" a package i.e. remove it from PATH, PKG_CONFIG_PATH, MAN_PATH, .. by removing it only from the STOW_TARGET ~/stowed.
I install any PACKAGE of version VERSION in:
So taking nim for example, I'd have: Under that, I'd have the whole FHS system for just nim 0.17.1: I set ~/stowed/ as my STOW_TARGET. So on running stow, symlinks to all: get created in: I then have aliases set up to do something like "unstow PKG/OLD_VER" and "restow PKG/NEW_VER" when I want to change the package version.I skip the "restow" step if I just want to "soft uninstall" a package i.e. remove it from PATH, PKG_CONFIG_PATH, MAN_PATH, .. by removing it only from the STOW_TARGET ~/stowed.
"Hard uninstall" would be simply:
Or even: