Rapid Application Development with Open Source Software

Next: Upgrading Twitter Bootstrap UP: TOC

In this chapter we will:
a) update the operating system FreeBSD
b) update existing packages
c) update existing ports

Packages are compiled softwares whereas ports need to be compiled. Usually you would either use packages or ports. However, to reduce downtime and reduce administrative work, we depend mostly on packages and use ports when compilation parameters have to be supplied.

Lets start with updating the operating system FreeBSD by issuing these commands:

freebsd-update fetch; freebsd-update install
Looking up update.FreeBSD.org mirrors... 4 mirrors found. Fetching metadata signature for 10.2-RELEASE from update4.freebsd.org... done. Fetching metadata index... done. Fetching 2 metadata patches.. done. Applying metadata patches... done. Inspecting system... done. Preparing to download files... done. Fetching 29 patches.....10....20.... done. Applying patches... done. The following files will be updated as part of updating to 10.2-RELEASE-p12: /bin/freebsd-version /boot/kernel/linux.ko /boot/kernel/linux.ko.symbols /usr/bin/ntpq /usr/lib/libssl.a /usr/lib/libssl.so.7 /usr/lib/libssl_p.a /usr/lib32/libssl.a /usr/lib32/libssl.so.7 /usr/lib32/libssl_p.a /usr/sbin/ntp-keygen /usr/sbin/ntpd /usr/sbin/ntpdate /usr/sbin/ntpdc /usr/sbin/ntptime /usr/sbin/sntp /usr/share/doc/ntp/miscopt.html /usr/share/doc/ntp/ntp-keygen.html /usr/share/doc/ntp/ntp.conf.html /usr/share/doc/ntp/ntp.keys.html /usr/share/doc/ntp/ntpsnmpd.html /usr/share/man/man5/ntp.conf.5.gz /usr/share/man/man5/ntp.keys.5.gz /usr/share/man/man8/ntp-keygen.8.gz /usr/share/man/man8/ntpd.8.gz /usr/share/man/man8/ntpdc.8.gz /usr/share/man/man8/ntpq.8.gz /usr/share/man/man8/sntp.8.gz /var/db/mergemaster.mtree Installing updates... done.

FreeBSD is now up-to-date and the updates will be active after rebooting.

Now, lets update the already installed packages:

pkg update ; pkg upgrade
Updating FreeBSD repository catalogue... FreeBSD repository is up-to-date. All repositories are up-to-date. Updating FreeBSD repository catalogue... FreeBSD repository is up-to-date. All repositories are up-to-date. Checking for upgrades (55 candidates): 100% Processing candidates (55 candidates): 100% The following 29 package(s) will be affected (of 0 checked): Installed packages to be UPGRADED: python27: 2.7.11 -> 2.7.11_1 py27-pip: 7.1.2 -> 7.1.2_1 postgresql93-client: 9.3.10 -> 9.3.10_1 php56-xml: 5.6.16 -> 5.6.18 php56-tokenizer: 5.6.16 -> 5.6.18 php56-simplexml: 5.6.16 -> 5.6.18 php56-session: 5.6.16 -> 5.6.18 php56-phar: 5.6.16 -> 5.6.18 php56-pgsql: 5.6.16 -> 5.6.18 php56-pdo_pgsql: 5.6.16 -> 5.6.18 php56-pdo: 5.6.16 -> 5.6.18 php56-openssl: 5.6.16 -> 5.6.18 php56-opcache: 5.6.16 -> 5.6.18 php56-mcrypt: 5.6.16 -> 5.6.18 php56-mbstring: 5.6.16_1 -> 5.6.18_1 php56-json: 5.6.16 -> 5.6.18 php56-iconv: 5.6.16 -> 5.6.18 php56-hash: 5.6.16 -> 5.6.18 php56-gettext: 5.6.16 -> 5.6.18 php56-gd: 5.6.16 -> 5.6.18 php56-filter: 5.6.16 -> 5.6.18 php56-fileinfo: 5.6.16 -> 5.6.18 php56-exif: 5.6.16 -> 5.6.18 php56-dom: 5.6.16 -> 5.6.18 php56-curl: 5.6.16 -> 5.6.18 php56-ctype: 5.6.16 -> 5.6.18 php56: 5.6.16 -> 5.6.18 curl: 7.46.0_1 -> 7.47.0 ca_root_nss: 3.20.1 -> 3.21 The process will require 10 KiB more space. 19 MiB to be downloaded. Proceed with this action? [y/N]: y Fetching python27-2.7.11_1.txz: 100% 10 MiB 2.1MB/s 00:05 Fetching py27-pip-7.1.2_1.txz: 100% 2 MiB 1.8MB/s 00:01 Fetching postgresql93-client-9.3.10_1.txz: 100% 2 MiB 2.0MB/s 00:01 Fetching php56-xml-5.6.18.txz: 100% 19 KiB 19.7kB/s 00:01 Fetching php56-tokenizer-5.6.18.txz: 100% 8 KiB 8.0kB/s 00:01 Fetching php56-simplexml-5.6.18.txz: 100% 22 KiB 22.5kB/s 00:01 Fetching php56-session-5.6.18.txz: 100% 30 KiB 30.6kB/s 00:01 Fetching php56-phar-5.6.18.txz: 100% 99 KiB 101.9kB/s 00:01 Fetching php56-pgsql-5.6.18.txz: 100% 41 KiB 42.1kB/s 00:01 Fetching php56-pdo_pgsql-5.6.18.txz: 100% 18 KiB 18.0kB/s 00:01 Fetching php56-pdo-5.6.18.txz: 100% 43 KiB 44.3kB/s 00:01 Fetching php56-openssl-5.6.18.txz: 100% 43 KiB 43.9kB/s 00:01 Fetching php56-opcache-5.6.18.txz: 100% 61 KiB 62.9kB/s 00:01 Fetching php56-mcrypt-5.6.18.txz: 100% 15 KiB 15.2kB/s 00:01 Fetching php56-mbstring-5.6.18_1.txz: 100% 707 KiB 723.8kB/s 00:01 Fetching php56-json-5.6.18.txz: 100% 16 KiB 16.5kB/s 00:01 Fetching php56-iconv-5.6.18.txz: 100% 18 KiB 18.2kB/s 00:01 Fetching php56-hash-5.6.18.txz: 100% 114 KiB 117.1kB/s 00:01 Fetching php56-gettext-5.6.18.txz: 100% 7 KiB 6.7kB/s 00:01 Fetching php56-gd-5.6.18.txz: 100% 133 KiB 135.7kB/s 00:01 Fetching php56-filter-5.6.18.txz: 100% 19 KiB 19.7kB/s 00:01 Fetching php56-fileinfo-5.6.18.txz: 100% 191 KiB 195.7kB/s 00:01 Fetching php56-exif-5.6.18.txz: 100% 24 KiB 24.9kB/s 00:01 Fetching php56-dom-5.6.18.txz: 100% 54 KiB 55.2kB/s 00:01 Fetching php56-curl-5.6.18.txz: 100% 26 KiB 27.0kB/s 00:01 Fetching php56-ctype-5.6.18.txz: 100% 6 KiB 6.5kB/s 00:01 Fetching php56-5.6.18.txz: 100% 2 MiB 1.0MB/s 00:02 Fetching curl-7.47.0.txz: 100% 1 MiB 1.5MB/s 00:01 Fetching ca_root_nss-3.21.txz: 100% 329 KiB 337.3kB/s 00:01 Checking integrity... done (0 conflicting) [1/29] Upgrading python27 from 2.7.11 to 2.7.11_1... [1/29] Extracting python27-2.7.11_1: 100% [2/29] Upgrading php56 from 5.6.16 to 5.6.18... [2/29] Extracting php56-5.6.18: 100% [3/29] Upgrading ca_root_nss from 3.20.1 to 3.21... [3/29] Extracting ca_root_nss-3.21: 100% [4/29] Upgrading postgresql93-client from 9.3.10 to 9.3.10_1... [4/29] Extracting postgresql93-client-9.3.10_1: 100% [5/29] Upgrading php56-pdo from 5.6.16 to 5.6.18... [5/29] Extracting php56-pdo-5.6.18: 100% [6/29] Upgrading php56-hash from 5.6.16 to 5.6.18... [6/29] Extracting php56-hash-5.6.18: 100% [7/29] Upgrading curl from 7.46.0_1 to 7.47.0... [7/29] Extracting curl-7.47.0: 100% [8/29] Upgrading py27-pip from 7.1.2 to 7.1.2_1... [8/29] Extracting py27-pip-7.1.2_1: 100% [9/29] Upgrading php56-xml from 5.6.16 to 5.6.18... [9/29] Extracting php56-xml-5.6.18: 100% [10/29] Upgrading php56-tokenizer from 5.6.16 to 5.6.18... [10/29] Extracting php56-tokenizer-5.6.18: 100% [11/29] Upgrading php56-simplexml from 5.6.16 to 5.6.18... [11/29] Extracting php56-simplexml-5.6.18: 100% [12/29] Upgrading php56-session from 5.6.16 to 5.6.18... [12/29] Extracting php56-session-5.6.18: 100% [13/29] Upgrading php56-phar from 5.6.16 to 5.6.18... [13/29] Extracting php56-phar-5.6.18: 100% [14/29] Upgrading php56-pgsql from 5.6.16 to 5.6.18... [14/29] Extracting php56-pgsql-5.6.18: 100% [15/29] Upgrading php56-pdo_pgsql from 5.6.16 to 5.6.18... [15/29] Extracting php56-pdo_pgsql-5.6.18: 100% [16/29] Upgrading php56-openssl from 5.6.16 to 5.6.18... [16/29] Extracting php56-openssl-5.6.18: 100% [17/29] Upgrading php56-opcache from 5.6.16 to 5.6.18... [17/29] Extracting php56-opcache-5.6.18: 100% [18/29] Upgrading php56-mcrypt from 5.6.16 to 5.6.18... [18/29] Extracting php56-mcrypt-5.6.18: 100% [19/29] Upgrading php56-mbstring from 5.6.16_1 to 5.6.18_1... [19/29] Extracting php56-mbstring-5.6.18_1: 100% [20/29] Upgrading php56-json from 5.6.16 to 5.6.18... [20/29] Extracting php56-json-5.6.18: 100% [21/29] Upgrading php56-iconv from 5.6.16 to 5.6.18... [21/29] Extracting php56-iconv-5.6.18: 100% [22/29] Upgrading php56-gettext from 5.6.16 to 5.6.18... [22/29] Extracting php56-gettext-5.6.18: 100% [23/29] Upgrading php56-gd from 5.6.16 to 5.6.18... [23/29] Extracting php56-gd-5.6.18: 100% [24/29] Upgrading php56-filter from 5.6.16 to 5.6.18... [24/29] Extracting php56-filter-5.6.18: 100% [25/29] Upgrading php56-fileinfo from 5.6.16 to 5.6.18... [25/29] Extracting php56-fileinfo-5.6.18: 100% [26/29] Upgrading php56-exif from 5.6.16 to 5.6.18... [26/29] Extracting php56-exif-5.6.18: 100% [27/29] Upgrading php56-dom from 5.6.16 to 5.6.18... [27/29] Extracting php56-dom-5.6.18: 100% [28/29] Upgrading php56-curl from 5.6.16 to 5.6.18... [28/29] Extracting php56-curl-5.6.18: 100% [29/29] Upgrading php56-ctype from 5.6.16 to 5.6.18... [29/29] Extracting php56-ctype-5.6.18: 100% Message from python27-2.7.11_1: =========================================================================== Note that some standard Python modules are provided as separate ports as they require additional dependencies. They are available as: bsddb databases/py-bsddb gdbm databases/py-gdbm sqlite3 databases/py-sqlite3 tkinter x11-toolkits/py-tkinter =========================================================================== Message from ca_root_nss-3.21: ********************************* WARNING ********************************* FreeBSD does not, and can not warrant that the certification authorities whose certificates are included in this package have in any way been audited for trustworthiness or RFC 3647 compliance. Assessment and verification of trust is the complete responsibility of the system administrator. *********************************** NOTE ********************************** This package installs symlinks to support root certificates discovery by default for software that uses OpenSSL. This enables SSL Certificate Verification by client software without manual intervention. If you prefer to do this manually, replace the following symlinks with either an empty file or your site-local certificate bundle. * /etc/ssl/cert.pem * /usr/local/etc/ssl/cert.pem * /usr/local/openssl/cert.pem *************************************************************************** Message from postgresql93-client-9.3.10_1: The PostgreSQL port has a collection of "side orders": postgresql-docs For all of the html documentation p5-Pg A perl5 API for client access to PostgreSQL databases. postgresql-tcltk If you want tcl/tk client support. postgresql-jdbc For Java JDBC support. postgresql-odbc For client access from unix applications using ODBC as access method. Not needed to access unix PostgreSQL servers from Win32 using ODBC. See below. ruby-postgres, py-PyGreSQL For client access to PostgreSQL databases using the ruby & python languages. postgresql-plperl, postgresql-pltcl & postgresql-plruby For using perl5, tcl & ruby as procedural languages. postgresql-contrib Lots of contributed utilities, postgresql functions and datatypes. There you find pg_standby, pgcrypto and many other cool things. etc... Message from py27-pip-7.1.2_1: ============================== !!!! WARNING !!!! ========================== pip MUST ONLY be used: * With the --user flag, OR * To install or manage Python packages in virtual environments Failure to follow this warning can and will result in an inconsistent system-wide Python environment (LOCALBASE/lib/pythonX.Y/site-packages) and cause errors. Avoid using pip as root unless you know what you're doing.

All Packages are now up-to-date.

In our environment some packages needs reinstallation such as pecl-memcached (Class memcached not found) . This can be resolved with the follwing commands:

pkg delete pecl-memcached; pkg install pecl-memcached
Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 1 packages (of 0 packages in the universe): Installed packages to be REMOVED: pecl-memcached-2.2.0_3 The operation will free 107 KiB. Proceed with deinstalling packages? [y/N]: y [1/1] Deinstalling pecl-memcached-2.2.0_3... [1/1] Deleting files for pecl-memcached-2.2.0_3: 100% root@41share:~ # pkg install pecl-memcached Updating FreeBSD repository catalogue... FreeBSD repository is up-to-date. All repositories are up-to-date. nginx-devel-1.9.9 is locked and may not be modified The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: pecl-memcached: 2.2.0_3 The process will require 107 KiB more space. 32 KiB to be downloaded. Proceed with this action? [y/N]: y Fetching pecl-memcached-2.2.0_3.txz: 100% 32 KiB 33.0kB/s 00:01 Checking integrity... done (0 conflicting) [1/1] Installing pecl-memcached-2.2.0_3... [1/1] Extracting pecl-memcached-2.2.0_3: 100%

Now lets update the ports.

portsnap fetch update
Looking up portsnap.FreeBSD.org mirrors... 7 mirrors found. Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done. Fetching snapshot metadata... done. Updating from Sat Jan 9 08:08:36 CET 2016 to Sat Feb 13 09:42:49 CET 2016. Fetching 4 metadata patches... done. Applying metadata patches... done. Fetching 4 metadata files... done. Fetching 3687 patches. (3687/3687) 100.00% done. done. Applying patches... Skipping e1756f98e674efa14daf ... /usr/ports/x11/yad/ /usr/ports/x11/yeahconsole/ Building new INDEX files... done.

We do not use the standard compile package for nginx. We will use the development version with HTTP_PERL and HTTPV2 enabled.

cd /usr/ports/www/nginx-devel/; make reinstall; rehash
===> License BSD2CLAUSE accepted by the user ===> Found saved configuration for nginx-devel-1.9.11 ===> nginx-devel-1.9.11 depends on file: /usr/local/sbin/pkg - found => nginx-1.9.11.tar.gz doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch http://nginx.org/download/nginx-1.9.11.tar.gz nginx-1.9.11.tar.gz 100% of 874 kB 534 kBps 00m02s ===> Fetching all distfiles required by nginx-devel-1.9.11 for building ===> Extracting for nginx-devel-1.9.11 => SHA256 Checksum OK for nginx-1.9.11.tar.gz. => SHA256 Checksum OK for mod_zip-1.1.6.tar.gz. ===> Patching for nginx-devel-1.9.11 ===> Applying FreeBSD patches for nginx-devel-1.9.11 ===> nginx-devel-1.9.11 depends on package: perl5>=5.20<5.21 - found ===> nginx-devel-1.9.11 depends on shared library: libGeoIP.so - found (/usr/local/lib/libGeoIP.so) ===> nginx-devel-1.9.11 depends on shared library: libpcre.so - found (/usr/local/lib/libpcre.so) ===> Configuring for nginx-devel-1.9.11 checking for OS + FreeBSD 10.2-RELEASE-p9 amd64 checking for C compiler ... found + using Clang C compiler checking for --with-ld-opt="-L /usr/local/lib" ... found checking for -Wl,-E switch ... found checking for gcc builtin atomic operations ... found ..... install -m 0644 /usr/ports/www/nginx-devel/work/nginx-1.9.11/objs/src/http/modules/perl/blib/lib/nginx.pm /usr/ports/www/nginx-devel/work/stage/usr/local/lib/perl5/site_perl/mach/5.20/ echo lib/perl5/site_perl/mach/5.20/auto/nginx/nginx.so >> /usr/ports/www/nginx-devel/work/.PLIST.mktmp echo lib/perl5/site_perl/mach/5.20/nginx.pm >> /usr/ports/www/nginx-devel/work/.PLIST.mktmp install -m 444 /usr/ports/www/nginx-devel/work/nginx-1.9.11/objs/nginx.8 /usr/ports/www/nginx-devel/work/stage/usr/local/man/man8 ====> Compressing man pages (compress-man) ===> Staging rc.d startup script(s) ===> Installing for nginx-devel-1.9.11 ===> Registering installation for nginx-devel-1.9.11 Installing nginx-devel-1.9.11... ===> Creating users and/or groups. Using existing group 'www'. Using existing user 'www'. ===> SECURITY REPORT: This port has installed the following files which may act as network servers and may therefore pose a remote security risk to the system. /usr/local/sbin/nginx This port has installed the following startup scripts which may cause these network services to be started at boot time. /usr/local/etc/rc.d/nginx If there are vulnerabilities in these programs there may be a security risk to the system. FreeBSD makes no guarantee about the security of ports included in the Ports Collection. Please type 'make deinstall' to deinstall the port if this is a concern. For more information, and contact details about the security status of this software, see the following webpage: http://nginx.org/

To list what packages could be upgraded issue this command

pkg version

In order to get security patches for the operating system the following commands are helpful:

freebsd-update fetch
freebsd-update install

Finally we reboot in order to make all changes active.

shutdown -r now
Next: Upgrading Twitter Bootstrap UP: TOC