How to verify sha512 checksum for FreeBSD ISO file

Hi,

I am playing with FreeBSD Unix after reading about new version 13 → FreeBSD 13 released: Here is how to upgrade FreeBSD 12 to 13 - nixCraft. So I downloaded two files from Index of /ftp/releases/amd64/amd64/ISO-IMAGES/13.0/

My question is how can I verify downloaded FreeBSD-13.0-RELEASE-amd64-bootonly.iso file? I have these two files:

  • CHECKSUM.SHA512-FreeBSD-13.0-RELEASE-amd64
  • CHECKSUM.SHA256-FreeBSD-13.0-RELEASE-amd64

I am unable to understand sha512 and sha256 syntax after reading the man page. Can you guide me and how to CHECKSUM file?

Use the shasum command to display and check/verify SHA checksums on the FreeBSD system.

How to check SHA256 checksum for downloaded FreeBSD DVD or ISO

shasum -a 256 --ignore-missing -c CHECKSUM.SHA256-FreeBSD-13.0-RELEASE-amd64 

You must see OK on the screen. For instance:

FreeBSD-13.0-RELEASE-amd64-dvd1.iso: OK

You can use that file when you see OK. Here is how bad checksum looks on the screen:

FreeBSD-13.0-RELEASE-amd64-dvd1.iso: FAILED
shasum: WARNING: 1 computed checksum did NOT match
shasum: CHECKSUM.SHA512-FreeBSD-13.0-RELEASE-amd64: no file was verified

Do now install such a file and again download it.

FreeBSD Command for checking checksum (512)

Again the same syntax, but it is as follows:

shasum -a 512 --ignore-missing -c CHECKSUM.SHA512-FreeBSD-13.0-RELEASE-amd64 

You can skip the -a option too:

shasum --ignore-missing -c CHECKSUM.SHA512-FreeBSD-13.0-RELEASE-amd64 

Where shasum command option to print or check SHA checksums are as follows:

  • -a : Algorithm to use. For example, 1 (default), 224, 256, 384, 512, 512224, 512256
  • -c : Read SHA sums from the FILEs and check them
  • --ignore-missing : Do not fail or report status for missing files

See:

1 Like

I was using wrong command.

No problem. Happy to help!


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki