You can install specific versions of libs with apt[1] but only if that happens to be compatible with your system deps... it's possible to run into trouble where one utility you install requires openssl 3 and another requires the latest version, and then you can't have both libs together easily. But normally, a distro is meant to keep a bunch of utilities with compatible versions for you. I just think that this way of doing things may not be appropriate for building software, and if you look at how Nix does it, for example, you can see that they break up with the traditional Linux distro system and let you have multiple environments with different libraries installed - and you can totally pin everything to make sure it will work forever (or until the sources/binaries can be fetched).
[1] https://askubuntu.com/questions/92019/how-to-install-specifi...