Case 1) Let's say some software isn't available in the repositories and you have to download it from a website and install it.
Case 2) You have downloaded a DRM free paid software but can no longer download the latest version (like Humble bundle without steam keys) and it has been sitting there forever and you find the need to use it again, but are not sure if it has been infected and you can't take a chance.
Case 3) You backed up your software to a USB storage and are not sure if it has been modified or infected but want to install it.
Case 4) You get software from a friend. You want to install it.
What can be done in the above cases to reduce the risk of malware?
Also please don't point that the chances of getting malware on linux are less.