Skip to content

The download finished after twenty minutes. You have a file of about 6 GB, named ubuntu-24.04.5.1-desktop-amd64.iso. The name is right and the size looks right.

But the name and the size say nothing about the bytes inside. A connection can break and corrupt part of the file. A website that copies Ubuntu’s files can serve a version that someone changed. A changed installer would still start, still install, and still look like Ubuntu.

By the end of this lesson, you can choose the right Ubuntu image for your computer, prove that your copy is exactly the file Ubuntu published, and explain what that proof does not cover.

  • VM, WSL, live media, and bare metal (B02.1), which explains why this course uses Ubuntu 24.04 LTS in a VM.
  • A computer with an internet connection and about 7 GB of free space.
  • You have no Linux system yet, so you run the real checks on your own computer. The Linux examples use the course’s lab system and small practice files, so you see each step first.

Ubuntu’s main page, ubuntu.com/download/desktop, offers the newest Ubuntu releases, which are not 24.04. This course is tested on 24.04, so download from the 24.04 release folders instead. The next section shows which one fits your processor:

The part after 24.04 in a file name is the point release: an update of 24.04 with the fixes released since. A folder can hold images of several point releases, and Ubuntu adds new ones, so take the desktop image with the highest number. When this lesson was checked, that was ubuntu-24.04.5.1-desktop-amd64.iso for amd64 and ubuntu-24.04.5-desktop-arm64.iso for arm64; the examples below use these names.

Each folder also has two small files at the top of the list. Download both into the same folder as the image, usually your Downloads folder:

  • SHA256SUMS, a text file with one line for each image in the folder.
  • SHA256SUMS.gpg, a signature for SHA256SUMS. Its purpose comes later in this lesson.

An image is built for one family of processors, an architecture. Ubuntu’s download page names two for desktops: “Intel or AMD 64-bit architecture”, called amd64, and “ARM 64-bit architecture”, called arm64. The name amd64 also covers Intel processors.

Pick the image that matches your computer’s processor. To find it:

  • Windows 11: open Settings, System, About. Under System type, “x64-based processor” means amd64, and “ARM-based processor” means arm64.
  • macOS: open the Apple menu and choose About This Mac. An item labeled Chip, with the name of an Apple chip, means arm64. An item labeled Processor, with the name of an Intel processor, means amd64.
  • Ubuntu or Debian: run dpkg --print-architecture in a terminal. It prints amd64 or arm64.

On the lab system, which runs on an Intel processor, the command prints:

Terminal window
dpkg --print-architecture
Output
amd64

The lab system cannot hold a 6 GB image, so the Linux examples use three small practice files. None is a real Ubuntu image:

  • practice-desktop.iso stands in for the image you downloaded. It is a 113-byte text file.
  • SHA256SUMS is a listing in the same format as Ubuntu’s.
  • altered/practice-desktop.iso is a copy with the same name and one character changed.

Check the file against the published value

Section titled “Check the file against the published value”

In the replay, cat prints the listing, and sha256sum prints the practice image’s checksum. The prompt learner@rootvolt:~/lab$ belongs to the lab system; you build your own ~/lab in lesson B04.1.

Checking a practice image against SHA256SUMS
learner@rootvolt:~/lab$ cat SHA256SUMSa7ec2c73dc8f5c824a27a3931f35bd0695837105838e51f843550c08ad3f8a6f *practice-desktop.iso
07419434e8a5be2f0731442851ce5fb8e69779461f76e7340a2808dc02e6282e *practice-server.isolearner@rootvolt:~/lab$ sha256sum practice-desktop.isoa7ec2c73dc8f5c824a27a3931f35bd0695837105838e51f843550c08ad3f8a6f  practice-desktop.isolearner@rootvolt:~/lab$ sha256sum -c --ignore-missing SHA256SUMSpractice-desktop.iso: OKlearner@rootvolt:~/lab$ 

Files ~/lab

  • ~
    • lab/cwd
      • altered/
        • practice-desktop.iso-rw-r--r--
      • practice-desktop.iso-rw-r--r--
      • SHA256SUMSargument-rw-r--r--

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. The checksum that sha256sum computes for practice-desktop.iso equals the one in SHA256SUMS, and sha256sum -c confirms it with OK.
Steps (10)
  1. Type cat SHA256SUMS — Print the published listing
  2. Press Enter
  3. Output: a7ec2c73dc8f5c824a27a3931f35bd0695837105838e51f843550c08ad3f8a6f *practice-desktop.iso 07419434e8a5be2f0731442851ce5fb8e69779461f76e7340a2808dc02e6282e *practice-server.iso
  4. Type sha256sum practice-desktop.iso — Compute the checksum of the downloaded file
  5. Press Enter
  6. Output: a7ec2c73dc8f5c824a27a3931f35bd0695837105838e51f843550c08ad3f8a6f practice-desktop.iso
  7. Type sha256sum -c --ignore-missing SHA256SUMS — Let sha256sum compare every character
  8. Press Enter
  9. Output: practice-desktop.iso: OK
  10. The computed checksum equals the published one, so the file arrived unchanged.

In words: cat SHA256SUMS prints two lines. Each line is a long code, a space, a *, and a file name. sha256sum practice-desktop.iso prints the same code that the listing gives for practice-desktop.iso. Then sha256sum -c --ignore-missing SHA256SUMS prints practice-desktop.iso: OK.

The long code is the file’s SHA-256 checksum. SHA-256 is a method that reads every byte of a file and turns them into a number of 256 bits, written as 64 characters from 0 to 9 and a to f. The same bytes always give the same checksum. Windows calls the checksum a hash; both words mean the same here.

Like Ubuntu’s listing, it also names a file you did not download, practice-server.iso. The * before each name marks how the file is read; the sha256sum manual notes that it makes no difference on GNU systems such as Ubuntu.

sha256sum -c reads the listing, computes the checksum of each file it names, and compares all 64 characters for you. --ignore-missing tells it to skip files that are not there.

The altered copy differs from the practice image in one character: not became now. Guess first: how much of its checksum changes? One character, a few, or most of them?

Terminal window
sha256sum practice-desktop.iso altered/practice-desktop.iso
Run it, then compare with your guess
Output
a7ec2c73dc8f5c824a27a3931f35bd0695837105838e51f843550c08ad3f8a6f practice-desktop.iso
bacb2f2472c5942659af01fadd138117072d5e9079af2d43098a52dcfb404ec3 altered/practice-desktop.iso

Almost every character is different. SHA-256 is designed this way: any change, even one bit, gives a checksum that looks unrelated.

An altered copy gets a different checksum
learner@rootvolt:~/lab$ cat practice-desktop.iso altered/practice-desktop.isoRootVolt practice image
This small text file stands in for an installation image.
It is not an operating system.
RootVolt practice image
This small text file stands in for an installation image.
It is now an operating system.learner@rootvolt:~/lab$ sha256sum practice-desktop.iso altered/practice-desktop.isoa7ec2c73dc8f5c824a27a3931f35bd0695837105838e51f843550c08ad3f8a6f  practice-desktop.iso
bacb2f2472c5942659af01fadd138117072d5e9079af2d43098a52dcfb404ec3  altered/practice-desktop.isolearner@rootvolt:~/lab$ 

Files ~/lab

  • ~
    • lab/cwd
      • altered/
        • practice-desktop.isolisted-rw-r--r--
      • practice-desktop.isolisted-rw-r--r--
      • SHA256SUMS-rw-r--r--

Step-by-step replay of a verified session · Recorded on Ubuntu 24.04.5 LTS, GNU Bash 5.2.21. The altered copy differs in one word, not and now, and its checksum shares nothing visible with the published one.
Steps (7)
  1. Type cat practice-desktop.iso altered/practice-desktop.iso — Print both files: one character differs
  2. Press Enter
  3. Output: RootVolt practice image This small text file stands in for an installation image. It is not an operating system. RootVolt practice image This small text file stands in for an installation image. It is now an operating system.
  4. Type sha256sum practice-desktop.iso altered/practice-desktop.iso — Compute both checksums
  5. Press Enter
  6. Output: a7ec2c73dc8f5c824a27a3931f35bd0695837105838e51f843550c08ad3f8a6f practice-desktop.iso bacb2f2472c5942659af01fadd138117072d5e9079af2d43098a52dcfb404ec3 altered/practice-desktop.iso
  7. One changed character gives a completely different checksum. It does not match SHA256SUMS, so the altered copy is rejected.

In words: cat prints both files, which differ only in not and now, and sha256sum prints two checksums that do not match. You reject the altered copy: delete it and download again.

sha256sum -c gives the same verdict. Run it from inside the altered folder: cd altered moves there (module B05 teaches cd), and ../SHA256SUMS names the listing in the folder above:

Terminal window
cd altered
sha256sum -c --ignore-missing ../SHA256SUMS
Output
practice-desktop.iso: FAILED
sha256sum: WARNING: 1 computed checksum did NOT match
sha256sum: ../SHA256SUMS: no file was verified

FAILED and did NOT match mean the file is not the one the listing describes.

Always compare the complete checksum. Checking only the first and last few characters is not enough: someone who makes many altered versions of a file can find one whose checksum starts and ends with the same few characters. Finding one that matches all 64 is not practical.

Now do the same with your real download, on your own computer. Open a terminal and change to the folder with the image. The commands below use the file names from the first section; type the name of the file you downloaded.

Open Windows PowerShell from the Start menu. It starts in your user folder.

Terminal window
cd Downloads
Get-FileHash .\ubuntu-24.04.5.1-desktop-amd64.iso | Format-List

Get-FileHash uses SHA-256 unless you ask for another method, and Format-List keeps the long checksum from being cut off. Windows prints capital letters and SHA256SUMS small ones; case does not matter here.

Computing the checksum of 6 GB takes a while; wait for the prompt to return. On Windows and macOS, open SHA256SUMS in Notepad or TextEdit, find the line that ends with your exact file name, and compare all 64 characters.

A matching checksum proves integrity: your file is exactly the file that SHA256SUMS describes.

It does not prove authenticity: that SHA256SUMS itself came from Ubuntu. Someone who can replace the image on the website can also replace the listing next to it, with the checksum of their own image, and your check would pass.

SHA256SUMS.gpg closes that gap. It is a digital signature: a value that Ubuntu computes from SHA256SUMS with a secret private key that only Ubuntu holds. Anyone can check the signature with Ubuntu’s matching public key. If even one character of SHA256SUMS changes, the check fails, and nobody without the private key can make a new signature that passes.

Check Proves Does not prove
Checksum of the image The image matches its line in SHA256SUMS That the listing came from Ubuntu
Signature of SHA256SUMS Ubuntu’s key signed the listing, and it was not changed Anything about the image by itself

Together, they form a chain: Ubuntu’s key vouches for the listing, and the listing vouches for the image.

The signature check needs the program gpg. Ubuntu includes it; on macOS, Ubuntu’s tutorial installs it with Homebrew. For Windows, the tutorial suggests Bash on Windows, which is WSL, but do not install WSL for this: lesson B02.1 explains that WSL 2 and VirtualBox are not a supported combination. Use Gpg4win, the Windows version of GnuPG named on GnuPG’s download page, and run the same commands in PowerShell. Without the signature, the checksum still proves integrity.

In the folder with both files, Ubuntu’s tutorial uses:

Terminal window
gpg --keyid-format long --verify SHA256SUMS.gpg SHA256SUMS

The first time, gpg reports Can't check signature: No public key, because it does not have Ubuntu’s public key yet. The tutorial downloads it from Ubuntu’s key server:

Terminal window
gpg --keyid-format long --keyserver hkp://keyserver.ubuntu.com --recv-keys 0x46181433FBB75451 0xD94AA3F0EFE21092

Run the --verify command again. Look for Good signature from "Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>". A BAD signature means the listing was changed: do not use it.

You will also see a warning that the key “is not certified with a trusted signature”. It means gpg cannot tell on its own that the key belongs to Ubuntu. You check that yourself: compare the key’s fingerprint, which gpg prints, with the one in Ubuntu’s tutorial, 8439 38DF 228D 22F7 B374 2BC0 D94A A3F0 EFE2 1092.

Errors for images you did not download. Without --ignore-missing, sha256sum -c also tries every other file in the listing:

Terminal window
sha256sum -c SHA256SUMS
Output
practice-desktop.iso: OK
sha256sum: practice-server.iso: No such file or directory
practice-server.iso: FAILED open or read
sha256sum: WARNING: 1 listed file could not be read

FAILED open or read means the file was not found, not that it is damaged. Only the line with your file name matters, and it says OK. A changed file gives FAILED without open or read, as the altered copy showed.

Checking the image instead of the listing. -c expects the listing, not the image:

Terminal window
sha256sum -c practice-desktop.iso
Error output
sha256sum: practice-desktop.iso: no properly formatted checksum lines found

sha256sum read the image and found no lines in the form “checksum, space, file name”. Give -c the file SHA256SUMS.

Comparing with the wrong line. SHA256SUMS lists several images whose names differ by a few characters: the point release, desktop or live-server, and the architecture. Before you decide that a download is damaged, check that you used the line with your exact file name.

A changed installer can add a hidden program to every system it installs, so attackers who control a download site, or a site that only looks official, have a reason to serve one. A checksum from a forum post, a video, or a course page, including this one, is only as trustworthy as whoever published it. That is why this lesson shows no checksum for the real image. The signature does not depend on where you got the files: Ubuntu’s tutorial says a matching signature means the listing is authentic, even from a mirror you do not trust.

Goal: Verify the Ubuntu image you will install in the next lesson.

  1. Find your computer’s architecture.
  2. Download the 24.04 desktop image for it, plus SHA256SUMS and SHA256SUMS.gpg, from the same folder.
  3. Compute the image’s SHA-256 checksum on your computer and compare it with its line in SHA256SUMS.
  4. If gpg is available to you, check the signature and the key fingerprint.

Expected: All 64 characters match. If you checked the signature, gpg reports a good signature from the Ubuntu CD Image Automatic Signing Key (2012), with the fingerprint from the tutorial.

Hint

The commands for each system are in “Check the real image on your computer”. If the checksums differ, check first that you are reading the line with your exact file name.

Solution
  1. Windows: Settings, System, About, System type. macOS: About This Mac, Chip or Processor. Ubuntu: dpkg --print-architecture.
  2. amd64: releases.ubuntu.com/24.04. arm64: cdimage.ubuntu.com/releases/24.04/release.
  3. The commands in “Check the real image on your computer”: Get-FileHash on Windows, shasum -a 256 on macOS, sha256sum -c --ignore-missing SHA256SUMS on Linux.
  4. The commands in “Check the signature”, with Gpg4win on Windows.

If the checksums differ, do not use the file. Delete it, download it again from the Ubuntu folder, and check again.

  • Download 24.04 from Ubuntu’s release folders: amd64 for Intel or AMD processors, arm64 for ARM.
  • A SHA-256 checksum is 64 characters computed from every byte of a file. One changed character gives a different checksum.
  • Compare the complete checksum with the line for your exact file name in SHA256SUMS, by eye or with sha256sum -c --ignore-missing SHA256SUMS.
  • A matching checksum proves integrity. The signature in SHA256SUMS.gpg, checked against Ubuntu’s key fingerprint, adds authenticity: the listing came from Ubuntu.

Next, in Creating and installing the VM (B02.3), you create the virtual machine and install Ubuntu from the image you verified.

All sources were checked on 1 November 2026, except the GnuPG download page, added on 2 November 2026.