Recommended secure way to install sofware not included in package manager

I had a related question about installing an appimage via a bash script.

Remember that if you can audit the script itself, then it’s fine to run it in a TemplateVM. What the script might download or install might still be malicious, or may be compromised in the future.