Sha256sum confusion

I downloaded the current Leap 16 offline iso via ktorrent and downloaded the associated checksum file. I then ran sha256sum on the checksum file:

sha256sum -c Leap-16.0-offline-installer-x86_64.install.iso.sha256
sha256sum: Leap-16.0-offline-installer-x86_64.install.iso: No such file or directory
Leap-16.0-offline-installer-x86_64.install.iso: FAILED open or read
sha256sum: WARNING: 1 listed file could not be read

I also ran

sha256sum -c ./Leap-16.0-offline-installer-x86_64.install.iso.sha256
sha256sum: Leap-16.0-offline-installer-x86_64.install.iso: No such file or directory
Leap-16.0-offline-installer-x86_64.install.iso: FAILED open or read
sha256sum: WARNING: 1 listed file could not be read

I note that the iso and checksum files have different base names:

Leap-16.0-offline-installer-x86_64-Build171.1.install.iso
Leap-16.0-offline-installer-x86_64.install.iso.sha256
(not sure if this makes a difference)

I then ran these two commands:

sha256sum Leap-16.0-offline-installer-x86_64.install.iso.sha256
280ccb28c151bb1bfca1142cd4db1fe0a65d746b2ff24347d4166d9f0881b623 Leap-16.0-offline-installer-x86_64.install.iso.sha256

sha256sum Leap-16.0-offline-installer-x86_64-Build171.1.install.iso
d780a228058fb4688a31b5bde22d7b97c86e04a2ced33f3d7c8e88a710d96d24 Leap-16.0-offline-installer-x86_64-Build171.1.install.iso

Different hashes, apparently. How to proceed?

Apparently you downloaded the checksum for another ISO.

You need to download the correct and matching files…
https://download.opensuse.org/distribution/leap/16.0/offline/

Leap-16.0-offline-installer-x86_64.install.iso.sha256
needs
Leap-16.0-offline-installer-x86_64.install.iso


Leap-16.0-offline-installer-x86_64-Build171.1.install.iso.sha256
needs
Leap-16.0-offline-installer-x86_64-Build171.1.install.iso

and so on…
The ISO and matching checksum files are available in the link provided above.

@susesteve:

The correct SHA256 check syntax is «takes a minute or two to complete executing»:

 > sha256sum -c Leap-16.0-offline-installer-x86_64.install.iso.sha256 
Leap-16.0-offline-installer-x86_64.install.iso: OK
 >

Please note the “-c” option:

       -c, --check
              read checksums from the FILEs and check them

Further help is documented in the “sha256sum” man page.

The correct syntax was used. But a checksum for another ISO was used. This can be seen in the terminal output.

Have a look at g.o.o:
The torrent link points to Leap-16.0-offline-installer-x86_64-Build171.1.install.iso
The direkt link points to Leap-16.0-offline-installer-x86_64.install.iso
The checksum link points to Leap-16.0-offline-installer-x86_64.install.iso.sha256
That means the checksum is not suitable for the torrent download.

So when you download the ISO via torrent, you need to chose the correct sha256 from the already provided mirror link.

1 Like

Ah, OK. Thanks to all.

This was the problem for as long as I remember.

Of course. You computed hashes of two different files. I hope they are different - this is the very purpose of the hashes.

Why are you trying to compute hash of the file containing hash of the ISO image?

Hi, the first of these commands is nonsense, because it computes the sha256sum of the text file containing the sha256sum (instead of the iso image), which isn’t of any relevance.

You should have observed that the execution of the second command, which calculates the sha256sum of the .iso of more than 4 GB took much more time than the execution of the first command.

The second of these commands yields the relevant sha256sum which you should compare with the checksum given on download.opensuse.org .

Both files/links
Leap-16.0-offline-installer-x86_64-Build171.1.install.iso.sha256
and
Leap-16.0-offline-installer-x86_64.install.iso.sha256
in
https://download.opensuse.org/distribution/leap/16.0/offline/
contain the same sha256sum which in addition is equal to the one that you have got by your second command.

Well, thanks to all for the instruction. As the title of the thread implies, I was confused. I did not realize that sha256sum calculates a number, I thought it extracted a number from a file.

Thanks again.