Apply Security Updates to FreeBSD with pkgng

By | 2014/04/01

FreeBSD has had a plethora of ways to install packages. FreeBSD has decided to make pkgng the new replacement for previous binary package managers.

Here’s is how to apply security updates to FreeBSD with pkgng!


1. Refresh package updates available (equivalent of sudo apt-get update):

$ sudo pkg update 

2. Next, upgrade packages on your system (equivalent of sudo apt-get upgrade):

$ sudo pkg upgrade

Below is an example output from one of my random servers:

[scott@mwa0 ~]$ sudo pkg update
Password:
Updating repository catalogue

digests.txz                                   100% 1073KB   1.1MB/s   1.1MB/s   00:00    
packagesite.txz                               100% 4971KB   4.9MB/s   3.8MB/s   00:01    
Incremental update completed, 22947 packages processed:
14073 packages updated, 475 removed and 84 added.

[scott@mwa0 ~]$ sudo pkg upgrade
Updating repository catalogue

Upgrades have been requested for the following 14 packages:

        Upgrading ca_root_nss: 3.15.4 -> 3.15.5
        Reinstalling curl-7.35.0 (options changed)
        Upgrading dejavu: 2.34_2 -> 2.34_3
        Reinstalling libexecinfo-1.1_3 (options changed)
        Upgrading libffi: 3.0.13 -> 3.0.13_1
        Upgrading libiconv: 1.14_1 -> 1.14_3
        Upgrading libyaml: 0.1.4_2 -> 0.1.4_3
        Upgrading nginx: 1.4.6,1 -> 1.4.7,1
        Upgrading p5-IO-Socket-SSL: 1.969 -> 1.972
        Upgrading ruby: 1.9.3.448,1 -> 1.9.3.484_2,1
        Upgrading tcl86: 8.6.0_2 -> 8.6.1
        Upgrading gettext: 0.18.3 -> 0.18.3.1
        Upgrading sudo: 1.8.7_1 -> 1.8.10.p2
        Reinstalling vim-7.4.205_1 (direct dependency changed)

The upgrade will require 433 kB more space

17 MB to be downloaded

Proceed with upgrading packages [y/N]: y

ca_root_nss-3.15.5.txz                        100%  296KB 295.8KB/s 295.8KB/s   00:00    
pkg: cached package curl-7.35.0: checksum mismatch, fetching from remote

curl-7.35.0.txz                               100% 1210KB   1.2MB/s   1.2MB/s   00:01    
dejavu-2.34_3.txz                             100% 2221KB   2.2MB/s   2.2MB/s   00:00    
libiconv-1.14_3.txz                           100%  591KB 591.4KB/s 591.4KB/s   00:00    
nginx-1.4.7,1.txz                             100%  244KB 244.3KB/s 244.3KB/s   00:00    
p5-IO-Socket-SSL-1.972.txz                    100%   76KB  75.9KB/s  75.9KB/s   00:00    
ruby-1.9.3.484_2,1.txz                        100% 3998KB   3.9MB/s   3.9MB/s   00:00    
pkg: cached package gettext-0.18.3.1: checksum mismatch, fetching from remote
gettext-0.18.3.1.txz                          100% 2070KB   2.0MB/s   2.0MB/s   00:00    
pkg: cached package sudo-1.8.10.p2: checksum mismatch, fetching from remote
sudo-1.8.10.p2.txz                            100%  720KB 720.1KB/s 720.1KB/s   00:00    
pkg: cached package vim-7.4.205_1: checksum mismatch, fetching from remote
vim-7.4.205_1.txz                             100% 5921KB   5.8MB/s   4.6MB/s   00:01    
Checking integrity... done
[1/14] Upgrading ca_root_nss from 3.15.4 to 3.15.5... done
[2/14] Reinstalling curl-7.35.0... done
[3/14] Upgrading dejavu from 2.34_2 to 2.34_3... done
[4/14] Reinstalling libexecinfo-1.1_3... done
[5/14] Upgrading libffi from 3.0.13 to 3.0.13_1... done
[6/14] Upgrading libiconv from 1.14_1 to 1.14_3... done
[7/14] Upgrading libyaml from 0.1.4_2 to 0.1.4_3... done
[8/14] Upgrading nginx from 1.4.6,1 to 1.4.7,1...===> Creating users and/or groups.
Using existing group 'www'.
Using existing user 'www'.
 done
[9/14] Upgrading p5-IO-Socket-SSL from 1.969 to 1.972... done
[10/14] Upgrading ruby from 1.9.3.448,1 to 1.9.3.484_2,1... done
[11/14] Upgrading tcl86 from 8.6.0_2 to 8.6.1... done
[12/14] Upgrading gettext from 0.18.3 to 0.18.3.1... done
[13/14] Upgrading sudo from 1.8.7_1 to 1.8.10.p2... done
[14/14] Reinstalling vim-7.4.205_1... done
Make sure that the freetype module is loaded.  If it is not, add the following
line to the "Modules" section of your X Windows configuration file:

        Load "freetype"

Add the following line to the "Files" section of X Windows configuration file:

        FontPath "/usr/local/lib/X11/fonts/dejavu/"

Note: your X Windows configuration file is typically /etc/X11/XF86Config
if you are using XFree86, and /etc/X11/xorg.conf if you are using X.Org.






====
Some of the standard commands are provided as separate ports for ease
of upgrading:

        devel/ruby-gems:        gem - RubyGems package manager
        devel/rubygem-rake:     rake - Ruby Make

And some of the standard libraries are provided as separate ports
since they require extra dependencies:

        converters/ruby-iconv:  iconv module
        databases/ruby-gdbm:    GDBM module
        x11-toolkits/ruby-tk:   Tcl/Tk modules
        japanese/ruby-tk:       Tcl/Tk modules for Japanized Tcl/Tk

Install them as occasion demands.
====




[scott@mwa0 ~]$ 


More on pkgng:
https://wiki.freebsd.org/pkgng

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.