# pkgng and portmaster



## polhallen (Dec 23, 2013)

Hi all, using FreeBSD 9.2-RELEASE I installed pkgng from ports, added 
	
	



```
WITH_PKGNG=yes
```
 to /etc/make.conf and did `pkg2ng`. Everything ok. But I have a strange situation (i.e. OpenVPN):

I installed OpenVPN from ports (latest version). If I do `pkg upgrade`, pkg wants to reinstall OpenVPN:

```
Reinstalling openvpn-2.3.2 (options changed)
```
Why? And why If I upgrade using pkgng did I lose its build configuration?

I use portmaster for upgrading ports, but when I use `pkg upgrade`, pkg wants to re-install some packages.

Thanks for the help.


----------



## phoenix (Dec 23, 2013)

You really, really, really shouldn't mix binary packages and custom-built ports.

Why?  Because the OPTIONS selected will differ.

All of the binary packages in the repo are built at the same time, using the default OPTIONS.  If you custom compile something, it will be using a different ports tree than the repo (meaning versions of apps will be different) and the OPTIONS selected will be differnet.  When you go to upgrade via the package tools, it'll notice the OPTIONS changed (hence the message) and will reinstall it using the version in the repo.

So, my advice is to *either* use binary packages, *or* the ports tree, and to *not* combine the two.

If you really must combine the two, then look into a tool like ports-mgmt/poudriere to build your own custom binary packages, and only use the binary package tools to install them (ignore the ports tree).


----------



## polhallen (Dec 25, 2013)

Hi @phoenix, thanks for your reply. Understood!  Now I have this problem:

```
pkg_info

bash-4.2.45         The GNU Project's Bourne Again SHell
pkg_info: the package info for package 'bdftopcf-1.0.4' is corrupt
pkg_info: the package info for package 'binutils-2.24' is corrupt
bison-2.7.1,1       A parser generator from FSF, (mostly) compatible with Yacc
bmon-2.1.0_4        Portable bandwidth monitor and rate estimator
pkg_info: the package info for package 'ca_root_nss-3.15.3.1' is corrupt
pkg_info: the package info for package 'cairo-1.10.2_7,2' is corrupt
ccrypt-1.10         Command-line utility for encrypting and decrypting files an
cmake-2.8.12.1      Cross-platform Makefile generator
pkg_info: the package info for package 'cmake-modules-2.8.12.1_1' is corrupt
```

Any idea to solve this problem?

Thanks!


----------



## wblock@ (Dec 25, 2013)

After switching to "PKGNG" (pkg(8)). none of the old "pkg_" commands with an underline in their name work any more.  Stop using them, and only use pkg(8).


----------

