Fixing issues with FreeBSD's pkgng system

Awhile back I updated my FreeBSD 9 box to run with its new package management tool pkgng. This was a huge headache. The official pkgng repo is still not active and im using the one located at Exobetric right now.

To use this repo add this line to /usr/local/etc/pkg.conf

PACKAGESITE         : http://mirror.exonetric.net/pub/pkgng/${ABI}/latest

After that make sure you have your system updated with the latest version of pkg as stated in the FreeBSD handbook: http://www.freebsd.org/doc/en/books/handbook/pkgng-intro.html

Finally if you run pkg update it will update the available packages from the repo. Then run pkg upgrade and it should upgrade all the installed packages. However for me there were a number of old or corrupt packages installed. For me some had to be removed using only the legacy pkg_delete tool, or some with pkg remove <package>

After I had deleted the offending packages I could see what was left installed by running pkg info. Everything looked ok and finally pkg upgrade would work. Still was a big hassle. Ugh.

Anyways here is a simple script to help you keep your system up to date. Stick it in your crontab and run it say @weekly to keep up to date.


#/usr/bin/bash

echo "#### Checking for FreeBSD System Updates ####"
freebsd-update fetch
freebsd-update install

echo "#### Checking for Package Updates ####"
pkg update
pkg upgrade

Comments

Popular posts from this blog

Roland Juno-6 Repairs

JP-8000 Battery Change

Best Albums of 2021