Linuxbrew is pretty convenient for installing dependencies, especially on "stable" distributions like Debian/Ubuntu. You can install specific versions of dependencies that you want, even keep them side-by-side.
It's also distro-agnostic, so it works almost everywhere.
Looks interesting. It both says that installing without sudo is a feature, which sounds neat, and that installing into ~/.linuxbrew is an unsupported feature.
# On Linux, it installs to /home/linuxbrew/.linuxbrew if you have sudo access
# and ~/.linuxbrew (which is unsupported) if run interactively.
HOMEBREW_PREFIX_DEFAULT="/home/linuxbrew/.linuxbrew"
HOMEBREW_CACHE="${HOME}/.cache/Homebrew"
brew is a really nice package installer that works with both MacOS and Linux.