Updated for the latest version: 0.15.1
You need to verify the signing key's fingerprint, before you import it:
cat laanwj-releases.asc | gpg --with-fingerprint --with-colons - | sed -ne 's|^fpr:::::::::\([0-9A-F]\+\):$|\1|p'
It should say:
> 01EA5486DE18A882D4C2684590C8019E36C2E964
Do not continue, if it does not match!
The signing key needs to be imported:
gpg --import laanwj-releases.asc 2>&1 | grep 36C2E964
It should say:
> gpg: key 36C2E964: "Wladimir J. van der Laan (Bitcoin Core binary release signing key) <[email protected]>" imported
Now, we check the hash sum containing file's signature:
gpg --verify SHA256SUMS.asc
It should say:
> gpg: Signature made Sat 11 Nov 2017 02:52:22 PM CET using RSA key ID 36C2E964
gpg: Good signature from "Wladimir J. van der Laan (Bitcoin Core binary release signing key) <[email protected]>"
And finally what we needed - to check that the hash sum of the file matches:
sha256sum --check --ignore-missing SHA256SUMS.asc 2>&1 | grep OK
It should say:
> bitcoin-0.15.1-x86_64-linux-gnu.tar.gz: OK
In case it does not output anything, something's wrong and you may verify this by running it without `| grep OK` on the end.