First Try...

My first attempt at blogging...

security output log on my server...

It has been a while that i keep getting these warnings on the daily security log on one of my servers:

Checking for packages with mismatched checksums:
python3-3_3: /usr/local/bin/pydoc3
python3-3_3: /usr/local/bin/python3
python3-3_3: /usr/local/bin/python3-config

And because mostly of laziness i never worried too much, and never did a basic investigation on why these messages where showing up.
Initially i thought they were related to a install that had gone not so correct, or actually a corrupted file or a mismatch on checksums somehow.
I also thought as you upgrade the packages/ports these errors/warnings will go away.

But they never did, and i think that they also moved in terms of which files it was complaining about whenever i upgraded, in the above case, the python version.

So today, i planned to move to a new python version, 3.11, and the messages annoyed me a bit inside my head, so decided to investigate a bit further and see what was causing and if there was a way of fixing them (removing them).

With google is your friend, i typed the search words copied from the output:

Checking for packages with mismatched checksums

Et voila, several results matched, and a blog post at Herr Bischoff blog, caught my attention:

FreeBSD 13: How to Solve Python Packages Mismatched Checksums With pycache Files in Daily Security Run Output


In the post it refers to a forum post at freebsd.org that the origin of these messages on the security output might have been related to some commit in the ports tree that had been reverted.

The important learning part for me, as an initial approach i was going to deinstall and resinstall the packages to see if it solved the problem, but reading the post and the freebsd.org forum post i could see what things could be solved/fixed by using pkg-check.
First you do a check on the all the packages and detect packages with invalid checksums:

# pkg check -sa

And then if mismatched checksums are found (which they should be) you run, to recalculate and set all the checksums for all the packages:

# pkg check -r

As final step you can repeat the first command to check if the problems have been solved.

This is the approach i done, and it seems it has at least on the rerun, off the checksums check, to have removed the warnings. Now just lets see what the overnight security output will show.

[UPDATE - 2024-06-09] Warnings are gone from the daily security output.