$linuxjunkies
>

Verify a Linux ISO with Checksums and GPG

Learn to verify a Linux ISO using sha256sum and GPG signatures, fetch signing key fingerprints, and respond safely to any checksum or signature mismatch.

BeginnerUbuntuDebianFedoraArch7 min readUpdated June 7, 2026

Before you start

  • A terminal with gpg and sha256sum available (both are standard on most Linux systems)
  • An internet connection to reach the official distribution download site over HTTPS
  • The ISO, checksum file, and signature file downloaded into the same working directory

Downloading a Linux ISO without verifying it is like accepting a sealed envelope without checking the wax stamp. Checksum verification catches accidental corruption; GPG signature verification proves the file actually came from the distribution's signing key. Both steps together give you confidence before you write anything to disk.

Two Layers of Verification

Most distributions ship at least one SHA-256 checksum file (sometimes SHA-512) alongside their ISOs. That checksum lets you confirm the file arrived intact. A separate GPG signature on that checksum file proves the distribution project itself generated it, not an attacker who replaced the file on a mirror. Always do both when they are available.

Step 1: Download the ISO, Checksum, and Signature Files

Go to the official distribution download page—not a random mirror link from a forum post. For this guide, Ubuntu 24.04 LTS is used as the example, but the process is nearly identical for Fedora, Debian, Arch, and others.

You typically need three files from the same directory:

  • The ISO itself: ubuntu-24.04-desktop-amd64.iso
  • The checksum file: SHA256SUMS
  • The GPG signature of the checksum file: SHA256SUMS.gpg
wget https://releases.ubuntu.com/24.04/ubuntu-24.04-desktop-amd64.iso
wget https://releases.ubuntu.com/24.04/SHA256SUMS
wget https://releases.ubuntu.com/24.04/SHA256SUMS.gpg

Fedora names these files differently. Look for Fedora-Workstation-Live-x86_64-40-1.14.iso, a *-CHECKSUM file, and the matching *-CHECKSUM.asc. Debian ships SHA512SUMS and SHA512SUMS.sign. The logic is the same regardless of the exact filenames.

Step 2: Verify the SHA-256 Checksum

Run sha256sum against the ISO and compare it to what the checksum file says. The -c flag automates this comparison when the ISO is in the same directory as the checksum file.

sha256sum -c SHA256SUMS --ignore-missing

The --ignore-missing flag skips lines in the checksum file that refer to ISOs you did not download, so you do not get spurious failures. A passing result looks like:

ubuntu-24.04-desktop-amd64.iso: OK

If you see FAILED, stop. The file is corrupted or tampered with. Delete it and re-download from the official source, preferably over HTTPS from a different mirror.

For SHA-512 (Debian), use sha512sum -c SHA512SUMS --ignore-missing instead.

Step 3: Fetch the Distribution's Signing Key

A checksum match only tells you the file is intact. You still need to confirm the checksum file itself was signed by the distribution. First, obtain the correct key fingerprint from the distribution's official documentation page (not from a keyserver alone—a keyserver is a directory, not an authority).

Ubuntu

Ubuntu's ISO signing key fingerprint is documented at ubuntu.com. Import it from Ubuntu's keyserver:

gpg --keyid-format long --keyserver hkps://keyserver.ubuntu.com \
    --recv-keys 843938DF228D22F7B3742BC0D94AA3F0EFE21092

Fedora

Fedora publishes its keys at getfedora.org/security. Import directly from their key file:

curl -O https://fedoraproject.org/fedora.gpg
gpg --import fedora.gpg

Debian

Debian signing keys are in the debian-keyring package. Install it, then import:

sudo apt install debian-keyring
gpg --import /usr/share/keyrings/debian-role-keys.gpg

Arch Linux

gpg --keyserver keyserver.ubuntu.com \
    --recv-keys 3E80CA1A8B89F69CBA57D98A76A5EF9054449A5C

Step 4: Verify the GPG Signature

With the key imported, verify that the checksum file was signed by it:

gpg --verify SHA256SUMS.gpg SHA256SUMS

For Debian (detached .sign file):

gpg --verify SHA512SUMS.sign SHA512SUMS

A good result includes a line like:

gpg: Good signature from "Ubuntu CD Image Automatic Signing Key (2012) <[email protected]>"

You will almost certainly also see a warning like gpg: WARNING: This key is not certified with a trusted signature!. That warning means the key is not in your personal web of trust—it does not mean the signature is invalid. What matters is that the fingerprint in the output matches the one you retrieved from the official documentation.

Explicitly check the fingerprint in the output against what the distribution documents:

gpg --fingerprint 843938DF228D22F7B3742BC0D94AA3F0EFE21092

Step 5: What to Do on a Mismatch

A failed SHA-256 check or a BAD signature result requires immediate action:

  • SHA-256 mismatch: The ISO is corrupted or has been altered. Re-download from the official HTTPS URL. If the mismatch persists across multiple downloads, report it to the distribution's security team.
  • BAD signature: The checksum file itself was modified after signing. This is a serious red flag. Do not use the ISO. Contact the distribution's security team and avoid that mirror entirely.
  • Key not found / import fails: Double-check the fingerprint against official documentation. Keyservers occasionally have outages; try an alternative keyserver or download the key directly from the project's HTTPS site.
  • Wrong key signed it: Some distributions rotate keys between releases. Verify you are checking against the key documented for the specific release version you downloaded.

Verification on Windows and macOS

If you download an ISO on a non-Linux machine before flashing it, you can still verify. On Windows, CertUtil -hashfile ubuntu.iso SHA256 handles checksums, and Gpg4win handles GPG. On macOS, shasum -a 256 ubuntu.iso and the system gpg from Homebrew work the same way.

Troubleshooting

gpg: keyserver receive failed

Keyserver connectivity is unreliable. Try hkps://keys.openpgp.org as an alternative, or download the raw key file directly from the distribution's HTTPS site and import with gpg --import keyfile.gpg.

sha256sum: command not found

Install the coreutils package. It is present by default on virtually every Linux system; you may be on a minimal container image.

# Debian/Ubuntu
sudo apt install coreutils

# Fedora/RHEL
sudo dnf install coreutils

# Arch
sudo pacman -S coreutils

Checksum file has Windows line endings

If you edited or copied the checksum file through a Windows tool, sha256sum may fail due to carriage returns. Fix with dos2unix SHA256SUMS before re-running the check.

tested on:Ubuntu 24.04Fedora 40Debian 12Arch 2024.05.01

Frequently asked questions

Do I really need GPG verification if the SHA-256 checksum already passes?
Yes. A checksum only proves the file is intact. If an attacker compromises a mirror and replaces both the ISO and the checksum file, sha256sum will still report OK. GPG verification proves the checksum file was signed by the distribution's private key, which the attacker does not have.
What does the 'This key is not certified with a trusted signature' warning mean?
It means the imported key is not connected to your personal GPG web of trust—it does not mean the signature is bad. As long as gpg reports 'Good signature' and the fingerprint matches the one documented on the official site, your verification is valid.
The distribution only provides a .asc file, not a .gpg file. Is that different?
No, both are GPG signature files. A .asc file is ASCII-armored (plain text) and a .gpg file is binary, but gpg --verify handles both automatically with the same syntax.
Can I verify an ISO after it has already been written to a USB drive?
You can re-read the device with dd and pipe it to sha256sum, but it is easier and more reliable to verify before writing. The byte count must match exactly, and USB reads are slower and more error-prone than reading a local file.
How do I know which key fingerprint to trust if I am new to a distribution?
Always get the fingerprint from the distribution's own HTTPS website (look for a 'verify download' or 'security' page). Some projects also publish fingerprints in signed release announcements on their mailing lists, which provides an additional cross-reference.

Related guides