FreeBSD - Ports complain about Checksum Mismatch error

File integrity checking has been built in for ports, checksum of file. Comparing checksum of a file is automatically done when ports is going to extract the compress file. It's a important process to make sure that the file downloaded are not altered in anyway, be it missing bits during download or some one maliciously change the contents of the original compress file. Imaging, what would happen if some one insert a trojan house or some spyware into the installation file and happen to be download and installed by users on the internet. The consequences is un-imaginably scary.

But this may not always be the case as ports takes its source from well known web sites and the ports are written by the author of the program which happen to be a commiter port maintainer which (please correct me if this is not the case) gone through a thorough process of checks & verification.

Warning of checksum error may most of the time caused by bumpy download connection that break the downloaded file. e.g. missing bits, halfway terminated file download process.

During installation of the ports, it will complain an error :
=> MD5 Checksum mismatch for bind-9.7.0rc1.tar.gz.
=> SHA256 Checksum mismatch for bind-9.7.0rc1.tar.gz.
=> MD5 Checksum OK for bind-9.7.0rc1.tar.gz.asc.
=> SHA256 Checksum OK for bind-9.7.0rc1.tar.gz.asc.
===>  Giving up on fetching files: bind-9.7.0rc1.tar.gz bind-9.7.0rc1.tar.gz
Make sure the Makefile and distinfo file (/usr/ports/dns/bind97/distinfo)
are up to date.  If you are absolutely sure you want to override this
check, type "make NO_CHECKSUM=yes [other args]".
*** Error code 1

Stop in /usr/ports/dns/bind97.
*** Error code 1

Stop in /usr/ports/dns/bind97.
*** Error code 1

Stop in /usr/ports/dns/bind97.

Try the below solution :
  1. Some time these checksum errors can be caused by "portsnap fetch update" did not grep the checksum in time. Re-do a "portsnap fetch update" then retry the installation. If the error still persist, try the next step.
  2. Most likely the downloaded program did not completed properly. Remove the file(s) /usr/ports/distfiles :
    • e.g. (in this case) /usr/ports/distfiles/bind-9.7.0rc1.tar.gz

    Retry the installation again.

Au revoir !!!

No comments: