π ~1 min read
Table of contents
Symptom & Impact
pkg update and pkg upgrade fail with repository metadata mismatch errors, delaying patching windows.
Environment & Reproduction
Common after stale mirror caches or interrupted catalog refresh on FreeBSD 14 hosts.
freebsd-version
pkg -vv | head -n 40
Root Cause Analysis
Local package catalog state diverges from remote repository metadata and checksum indexes.
Quick Triage
Validate DNS and force a catalog refresh before deeper remediation.
drill pkg.freebsd.org
pkg update -f
Step-by-Step Diagnosis
Inspect repository definitions and stale sqlite metadata under /var/db/pkg.
grep -R 'url:' /etc/pkg /usr/local/etc/pkg/repos
ls -lah /var/db/pkg

Solution – Primary Fix
Remove stale repo databases, bootstrap pkg metadata again, and retry upgrades.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
rm -f /var/db/pkg/repo-*.sqlite
pkg bootstrap -f
pkg update -f
pkg upgrade -y

Solution – Alternative Approaches
Temporarily pin to a known-good internal mirror while upstream mirrors stabilize.
Verification & Acceptance Criteria
Repository refresh and dry-run upgrade complete with no checksum or catalog errors.
pkg update
pkg upgrade -n
Rollback Plan
Restore previous repo config if a mirror override causes package drift.
cp -a /usr/local/etc/pkg/repos /usr/local/etc/pkg/repos.rollback.$(date +%F)
Prevention & Hardening
Standardize repository definitions and monitor fetch failures from package mirrors.
Related Errors & Cross-Refs
pkg: repository catalog is malformed, signature mismatch, failed to fetch repository meta.
Related tutorial: View the step-by-step tutorial for freebsd-14.
View all freebsd-14 tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
FreeBSD pkg handbook and repository operations guidance.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.