How to verify sha512 checksum for FreeBSD ISO file

Hi,

I am playing with FreeBSD Unix after reading about new version 13 → https://www.cyberciti.biz/open-source/freebsd-13-released-how-to-update-upgrade-freebsd-12-to-13/. So I downloaded two files from https://download.freebsd.org/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?

1 Like

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:
https://www.cyberciti.biz/faq/how-to-check-verify-md5-sha1-sha256-checksum-on-applemacosx/

2 Likes

I was using wrong command.

No problem. Happy to help!

Thanks,

Side note: this requires lang/perl5.36.

openssl(1) is integral to FreeBSD. Example usage:

root@macbookpro:/tmp # openssl sha512 ./FreeBSD-14.1-RELEASE-amd64-bootonly.iso.xz 
SHA2-512(./FreeBSD-14.1-RELEASE-amd64-bootonly.iso.xz)= 0dae82f0d98897dd56657e76aab2d4d3ea3e688f696ed5830de43b122116d6233c64cb357660143e1d439ee2bc0d4c90894b49c13648752206702049792ae798
root@macbookpro:/tmp # 
1 Like