How to verify that downloaded files such as Ubuntu, BitcoinQT, Armory, and Electrum have not been tampered with? When creating a secure offline wallet, the first step is to download some software or OS (such as Ubunutu) to create the wallet.

How can you verify that the software you are downloading has not been tampered with?

Some downloads have a SHA of the file on the download page. But a hacker could  change the SHA on the download page. So how do you know that the file is not tainted and the SHA is the correct SHA of the tainted file?

For example, the download page for Armory has installer files and SHA's for some of the files.

How would you verify that the download of Ubuntu is not tainted?
It all depends on the security mechanisms of your operating system. On Ubuntu, packages are signed, and the installer checks the signature. So, a man in the middle, or a rogue mirror site could not have modified the copy of Electrum that I installed.

The safety of your bitcoins on your machine does not depend only on your bitcoin applications. If the operating system itself is compromised, it can steal your bitcoins (using a keylogger to find the possible passwords) so pay attention to use a safe operating system, with security updates and so on.