π ~1 min read
Table of contents
Symptom & Impact
pkg update and pkg upgrade fail with repository or signature metadata mismatch errors, delaying security patching.
Environment & Reproduction
Usually appears after mirror rotation, interrupted updates, or stale local package catalogs.
freebsd-version
pkg -vv | head -n 40
Root Cause Analysis
Local repo catalog and remote package metadata differ, so pkg cannot safely resolve package indexes.
Quick Triage
Confirm DNS reachability and force a fresh catalog pull.
drill pkg.freebsd.org
pkg update -f
Step-by-Step Diagnosis
Inspect pkg configuration and cache artifacts for stale catalogs.
grep -R "url:" /etc/pkg /usr/local/etc/pkg/repos
ls -lah /var/db/pkg

Solution – Primary Fix
Clear stale package metadata and rebuild the local repository catalog.
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
Pin to a known-good internal mirror if upstream mirrors are unstable.
pkg -o REPOS_DIR=/usr/local/etc/pkg/repos update -f
Verification & Acceptance Criteria
Repository update and package upgrade complete without checksum or catalog errors.
pkg update
pkg upgrade -n
Rollback Plan
Restore previous repository config files if a mirror override causes package selection drift.
cp -a /usr/local/etc/pkg/repos /usr/local/etc/pkg/repos.rollback.$(date +%F)
Prevention & Hardening
Standardize repository definitions and monitor mirror latency and failures.
pkg stats
tail -n 100 /var/log/messages
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-13.
View all freebsd-13 tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
FreeBSD pkg handbook and package repository administration 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.