# Ports upgrade



## c00kie (Nov 17, 2012)

Hi

I'm struggling with a port upgrade on a FreeBSD server. I'm following advice that I found on the web:

/usr/ports/UPDATING contains notes about updating ports that require special procedures. Always, yes always, read this file 
for special notes before updating ports.

Upon browsing to http://www.freshports.org/lang/php5/ and scroll down to: Notes from UPDATING; 
the most recent entry is: 2012-05-16

Advice:
Only entries that have been added since the last time you updated ports are relevant. If you remember when that was, great! 
Otherwise, the most recent file in /var/db/pkg can give you a rough idea:

I do a quick check:

`# ls -ltr /var/db/pkg | tail -n1`

```
drwxr-xr-x  2 root  wheel      512 Jul 21 12:00 php5-zlib-5.4.4_1
```
So looks like I'm fine to go ahead...

`# portupgrade -a`


after 20 min say, the terminal reports:


```
** Listing the failed packages (-:ignored / *:skipped / !:failed)
	! textproc/libxml2 (libxml2-2.7.8_3)	(unknown build error)
	! databases/sqlite3 (sqlite3-3.7.13)	(unknown build error)
	! ports-mgmt/portupgrade (portupgrade-2.4.9.5,2)	(unknown build error)
	* lang/php5 (php5-5.4.4)
	* textproc/php5-dom (php5-dom-5.4.4)
	* textproc/php5-xmlreader (php5-xmlreader-5.4.4)
	* archivers/php5-zlib (php5-zlib-5.4.4_1)
	* databases/php5-pdo (php5-pdo-5.4.4)
	* security/php5-hash (php5-hash-5.4.4)
	* archivers/php5-phar (php5-phar-5.4.4)
	* textproc/php5-xml (php5-xml-5.4.4)
	* devel/php5-json (php5-json-5.4.4)
	* security/php5-filter (php5-filter-5.4.4)
	* databases/php5-mysqli (php5-mysqli-5.4.4)
	* databases/php5-sqlite3 (php5-sqlite3-5.4.4)
	* devel/php5-tokenizer (php5-tokenizer-5.4.4)
	* archivers/php5-zip (php5-zip-5.4.4)
	* sysutils/php5-posix (php5-posix-5.4.4)
	* textproc/php5-xmlwriter (php5-xmlwriter-5.4.4)
	* www/php5-session (php5-session-5.4.4)
	* graphics/php5-gd (php5-gd-5.4.4)
	* databases/php5-mysql (php5-mysql-5.4.4)
	* databases/php5-pdo_sqlite (php5-pdo_sqlite-5.4.4)
	* ftp/php5-curl (php5-curl-5.4.4)
	* textproc/php5-ctype (php5-ctype-5.4.4)
	* converters/php5-iconv (php5-iconv-5.4.4)
	* textproc/php5-simplexml (php5-simplexml-5.4.4)
```
and if I browse to my site, all I see in the browser is:

Error establishing a database connection

that's it, I can't see anything?



Back to my terminal and:

`# pkg_version -v`

```
libxml2-2.7.8_3                     <   needs updating (port has 2.7.8_5)
php5-5.4.4                          <   needs updating (port has 5.4.7)
php5-ctype-5.4.4                    <   needs updating (port has 5.4.7)
php5-curl-5.4.4                     <   needs updating (port has 5.4.7)
php5-dom-5.4.4                      <   needs updating (port has 5.4.7)
php5-filter-5.4.4                   <   needs updating (port has 5.4.7)
php5-gd-5.4.4                       <   needs updating (port has 5.4.7)
php5-hash-5.4.4                     <   needs updating (port has 5.4.7)
php5-iconv-5.4.4                    <   needs updating (port has 5.4.7)
php5-json-5.4.4                     <   needs updating (port has 5.4.7)
php5-mysql-5.4.4                    <   needs updating (port has 5.4.7)
php5-mysqli-5.4.4                   <   needs updating (port has 5.4.7)
php5-pdo-5.4.4                      <   needs updating (port has 5.4.7)
php5-pdo_sqlite-5.4.4               <   needs updating (port has 5.4.7)
php5-phar-5.4.4                     <   needs updating (port has 5.4.7)
php5-posix-5.4.4                    <   needs updating (port has 5.4.7)
php5-session-5.4.4                  <   needs updating (port has 5.4.7)
php5-simplexml-5.4.4                <   needs updating (port has 5.4.7)
php5-sqlite3-5.4.4                  <   needs updating (port has 5.4.7)
php5-tokenizer-5.4.4                <   needs updating (port has 5.4.7)
php5-xml-5.4.4                      <   needs updating (port has 5.4.7)
php5-xmlreader-5.4.4                <   needs updating (port has 5.4.7)
php5-xmlwriter-5.4.4                <   needs updating (port has 5.4.7)
php5-zip-5.4.4                      <   needs updating (port has 5.4.7)
php5-zlib-5.4.4_1                   <   needs updating (port has 5.4.7)
portupgrade-2.4.9.5,2               <   needs updating (port has 2.4.10.2,2)
sqlite3-3.7.13                      <   needs updating (port has 3.7.14.1)
```

My site is down and holy moly -it seems Ive f*^&$% up somewhere?


help


----------



## wblock@ (Nov 17, 2012)

c00kie said:
			
		

> Hi
> 
> I'm struggling with a port upgrade on a FreeBSD server. I'm following advice that I found on the web:
> 
> ...



That sounds familiar.



> Upon browsing to http://www.freshports.org/lang/php5/ and scroll down to: Notes from UPDATING;



But there you stop following the instructions and veer off into improvisation.  Why didn't you just read /usr/ports/UPDATING?  The problem is that it may have had instructions that were relevant to some of the other ports you already had installed, ports that affect the PHP install.  Some procedures affect the ports system and have to be done regardless.



> I do a quick check:
> 
> `# ls -ltr /var/db/pkg | tail -n1`
> 
> ...



Nope.  /usr/ports/UPDATING has lots of things after 2012-07-21.  The one for 2012-07-26 is needed on many systems, for example.

The good news is that you have the date.  So work through /usr/ports/UPDATING starting at that date.  Follow all the instructions that apply to a package you have installed or apply to the ports system in general.


----------



## c00kie (Nov 18, 2012)

wblock@ said:
			
		

> That sounds familiar.
> 
> But there you stop following the instructions and veer off into improvisation.  Why didn't you just read /usr/ports/UPDATING?


Yes, it's blind ignorance on my behalf. I guess I am going to learn by my mistakes. 



> The good news is that you have the date.  So work through /usr/ports/UPDATING starting at that date.  Follow all the instructions that apply to a package you have installed or apply to the ports system in general.



Great, thankyou. I found this very helpful also. So I run it with *-v-5m* to go back 5 months 

`$ /usr/sbin/pkg_updating -d `/bin/date -v-5m +%Y%m%d``

and the terminal spits out:


```
20121015:
  AFFECTS: users of ports-mgmt/portupgrade
  AUTHOR: bdrewery@FreeBSD.org

  Portupgrade now supports pkgng. To use pkgng, enable it in your make.conf,
  and convert your databases.

  This is optional and not currently required.

  # make -C /usr/ports/ports-mgmt/pkg install clean
  # echo 'WITH_PKGNG=yes' >> /etc/make.conf
  # pkg2ng
  # pkgdb -fu

20120902:
  AFFECTS: users of www/apache22, www/apache22-event-mpm, www/apache22-itk-mpm, www/apache22-peruser-mpm, www/apache22-worker-mpm
  AUTHOR: ohauer@FreeBSD.org

  The port use now the options NG framework, this means WITH_xxx
  directives are no longer valid.

  Additional:
  - APR only specific options like THREADS, MYSQL, PGSQL, SQLITE,
    BDB and IPV6 where removed.
  - PKGNAME has changed from apache-2... to apache22-2...
  - PROXY is now a MULTI directive which means at last one additional
    PROXY_(AJP|BALANCER|CONNECT|FTP|HTTP|SCGI) module is required.
  - CGI is only a valid option for MPM prefork, peruser and itk.

20120902:
  AFFECTS: users of devel/apr1
  AUTHOR: ohauer@FreeBSD.org

  APR was updated to 1.4.6 and APR-util was updated to 1.4.1.

  Please rebuild all ports which are using functions from
  APR/APR-util such as apache, subversion ...

  # portmaster -r apr
  or
  # portupgrade -r devel/apr1
  or
  # pkg install -fR devel/apr1

20120820:
  AFFECTS: users of ports-mgmt/portupgrade-devel
  AUTHOR:  bdrewery@FreeBSD.org

  Due to a bug introduced in 20120601, portupgrade is unable to
  upgrade itself on FreeBSD 7.x. This has been fixed in 20120820.
  ports-mgmt/portupgrade is not affected. To upgrade, execute the following:

  # make -C /usr/ports/ports-mgmt/portupgrade-devel all deinstall install clean

20120726:
  AFFECTS: users of devel/pkg-config
  AUTHOR: bapt@FreeBSD.org

  devel/pkg-config has been replaced by devel/pkgconf

  # portmaster -o devel/pkgconf devel/pkg-config
  or
  # portupgrade -fo devel/pkgconf pkg-config-\*

  pkgng:
  # pkg set -o devel/pkg-config:devel/pkgconf
  # pkg install -f devel/pkgconf
```

If I now execute all commands above as root I guess I'm getting closer?


----------



## c00kie (Nov 18, 2012)

*re:*

wo, everthings back. Thanks again.


----------



## c00kie (Nov 18, 2012)

c00kie said:
			
		

> wo, everthings back. Thanks again.



edit:

I spoke to soon, although I haven't learnt nothing from my endevours. It turns out that my MySQL server had stopped. Running 
`# /usr/local/etc/rc.d/mysql-server start` 
and my website is back. But back to my original problem of updating ports:

`# pkg_version -v` and


```
libxml2-2.7.8_3                     <   needs updating (port has 2.7.8_5)
php5-ctype-5.4.4                    <   needs updating (port has 5.4.7)
php5-curl-5.4.4                     <   needs updating (port has 5.4.7)
php5-dom-5.4.4                      <   needs updating (port has 5.4.7)
php5-filter-5.4.4                   <   needs updating (port has 5.4.7)
php5-gd-5.4.4                       <   needs updating (port has 5.4.7)
php5-hash-5.4.4                     <   needs updating (port has 5.4.7)
php5-iconv-5.4.4                    <   needs updating (port has 5.4.7)
php5-json-5.4.4                     <   needs updating (port has 5.4.7)
php5-mysql-5.4.4                    <   needs updating (port has 5.4.7)
php5-mysqli-5.4.4                   <   needs updating (port has 5.4.7)
php5-pdo-5.4.4                      <   needs updating (port has 5.4.7)
php5-pdo_sqlite-5.4.4               <   needs updating (port has 5.4.7)
php5-phar-5.4.4                     <   needs updating (port has 5.4.7)
php5-posix-5.4.4                    <   needs updating (port has 5.4.7)
php5-session-5.4.4                  <   needs updating (port has 5.4.7)
php5-simplexml-5.4.4                <   needs updating (port has 5.4.7)
php5-sqlite3-5.4.4                  <   needs updating (port has 5.4.7)
php5-tokenizer-5.4.4                <   needs updating (port has 5.4.7)
php5-xml-5.4.4                      <   needs updating (port has 5.4.7)
php5-xmlreader-5.4.4                <   needs updating (port has 5.4.7)
php5-xmlwriter-5.4.4                <   needs updating (port has 5.4.7)
php5-zip-5.4.4                      <   needs updating (port has 5.4.7)
php5-zlib-5.4.4_1                   <   needs updating (port has 5.4.7)
portupgrade-2.4.9.5,2               <   needs updating (port has 2.4.10.2,2)
sqlite3-3.7.13                      <   needs updating (port has 3.7.14.1)
```

My ports tree is up-to-date and I've followed /usr/ports/UPDATING to the letter? I'm now petrified of running:
`# portupgrade -a`


----------



## wblock@ (Nov 18, 2012)

/usr/ports/UPDATING shows updates that require special steps.  Once those are done, anything left over *should* be upgradable without special steps.  That "should" is there because I've seen people have trouble with PHP, but don't use it myself so I didn't pay attention and don't know if there is any reason not to just do a normal upgrade on it now.


----------



## c00kie (Nov 20, 2012)

*re:*

Looking at 
	
	



```
php5-mysql-5.4.4                    <   needs updating (port has 5.4.7)
php5-mysqli-5.4.4                   <   needs updating (port has 5.4.7)
php5-pdo-5.4.4                      <   needs updating (port has 5.4.7)
php5-pdo_sqlite-5.4.4               <   needs updating (port has 5.4.7)
php5-phar-5.4.4                     <   needs updating (port has 5.4.7)
php5-posix-5.4.4                    <   needs updating (port has 5.4.7)
php5-session-5.4.4                  <   needs updating (port has 5.4.7)
php5-simplexml-5.4.4                <   needs updating (port has 5.4.7)
php5-sqlite3-5.4.4                  <   needs updating (port has 5.4.7)
```
these appear to be PHP extensions. The most current version of PHP is: Current PHP 5.4 Stable: 5.4.8.

I'm on PHP 5.4.7

Looking at the ports tree, there doesn't appear to be a PHP 5.4.8? I'm thinking maybe wait until a new iteration of PHP comes into the ports? I may be completely wrong however?

Are up-to-date extensions really imperative?


----------

