Updating pkg FreeBSD 10.1

So, if you’re installing or upgrading to the current FreeBSD OS 10.1-RELEASE branch, you’ve probably heard…

The new preferred way to install open source packages is with the new package management tool, simply named ‘pkg’.  From the man page:

pkg provides an interface for manipulating packages: registering, adding, removing and upgrading packages.

Once you’ve got an account on a new FreeBSD system version 10.0 or later you’ll be able to ‘man pkg’ and see all the nifty options.  It was available before, but not necessarily installed by default as with version 10.0 and later (depending on which FreeBSD Branch you’re following:  Current (bleedy-edge development), Stable (kind of tested) or Release (mostly tested)) To me, the name Stable sounds like it’s production-worthy.  Not the case.  For the best tested and essentially, most reliable version of the OS out to date, conventional wisdom advises installing the Engineering Release Branch of FreeBSD).

To see which branch you’re running issue the command:

 uname -a

and you should see output something to the equivalent of:

10.1-RELEASE-p9 FreeBSD 10.1-RELEASE-p9 #0: Tue Apr  7 01:07:33 UTC 2015     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386

One of the key differences in moving from FreeBSD 9 to FreeBSD 10 is the new command and syntax to install and deinstall programs.  It is simple from a user’s perspective.  For example, from your shell of choice doing:

pkg install perl5-5.18

Will install Perl version 5.18.  Similarly:

pkg delete perl5-5.18

…will delete it!  To see all versions of Perl you have available to install do:

pkg search perl

Upgrading a package is just as easy:

pkg upgrade perl

should do the trick.

To update ALL packages that can be updated:

pkg upgrade

If installing via ‘pkg’ doesn’t work for some reason and it bombs, you can resort to installing via the ports directories using ‘make’, e.g.

cd /usr/ports/lang/perl5.18
make config
make clean install

Don’t worry about pkg losing track of whether you used it or the method above to get less-versatile packages installed.  pkg tracks your installations, deinstallations and dependencies faithfully, whether you are employing the pkg command or using the more traditional ‘make’ method shown above.

Finally, there’s a recommended standard everyone at the FreeBSD project seems to agree on.  Before pkg FreeBSD was something of a quagmire of mixed messages as far as ports and package management.

The addition of increasingly reliable ports management systems like pkg is one of the many reasons Tera Bear Consulting relies heavily on the FreeBSD UNIX operating system with confidence.  It’s proven the test of time for us in the critical areas of reliability, scalability, and rock-solid, online security.

Powered by FreeBSD

Upgrading to FreeBSD 10.1 is a snap with the pkg package manger!

About Jon Lybrook

Jon Lybrook is owner and chief developer of Tera Bear Consulting in Boulder Colorado.
This entry was posted in Application Hosting, FreeBSD, FreeBSD System Administration, Managed Dedicated Server Hosting, open source, Perl Development and tagged , , , . Bookmark the permalink.