Resolving Package Mismatches
If you don't periodically update BSD you might see these messages below from your packaging cache.
pkg: cached package ...: size mismatch, fetching from remote
pkg: cached package ...: size mismatch, cannot continue
pkg: cached package ...: size mismatch, cannot continue
How to Fix it?
Cleaning orphan cache and files
pkg clean
Remove all package caches
rm -rf /var/cache/pkg/*
Running pkg with -f If invoked an attempt will be made to reinstall pkg from remote repository.
pkg update -f
Optional
Only use this is the previous commands don't work. Removing the repo-FreeBSD.sqlite and initializing the below command.
rm /var/db/pkg/repo-FreeBSD.sqlite
Running following commands to initialize and reinstall the pkg package like below example and output
pkg bootstrap -f
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.12.0_1...
Newer FreeBSD version for package pkg: