# Pkg Breaking Updates



## dave (Mar 18, 2013)

Trying to use portmaster to update my ports.  Seems like pkg is breaking the update of zabbix-agent.


```
# portmaster -o net-mgmt/zabbix2-agent zabbix-agent-1.8.15,2
[...snip...]
===>   Registering installation for zabbix2-agent-2.0.5
Installing zabbix2-agent-2.0.5...pkg: zabbix2-agent-2.0.5 conflicts with zabbix-agent-1.8.15,2 (installs files into the same place).  Problematic file: /usr/local/man/man1/zabbix_get.1.gz
*** Error code 70
```

Strangely, it appears that zabbix-agent-1.8.15,2 is no longer installed on the system - so why would pkg be complaining about it being in conflict?


----------



## SirDice (Mar 19, 2013)

What's the output of `# pkg version` and `# pkg_version`?


----------



## dave (Mar 19, 2013)

pkg output seems fine even though portmaster wants to install pkg over and over:

```
# pkg version | grep -E '^(pkg|zab).*'
pkg-1.0.9_1                        =
pkgconf-0.9.1                      =
zabbix-agent-1.8.15,2              ?
```

pkg_version spits out several "corrupted record" lines like this:

```
# pkg_version
GeoIP                               =
pkg_version: corrupted record (pkgdep line without argument), ignoring
apcupsd                             =
apr                                 =
arc                                 =
pkg_version: corrupted record (pkgdep line without argument), ignoring
pkg_version: corrupted record (pkgdep line without argument), ignoring
pkg_version: corrupted record (pkgdep line without argument), ignoring
[...snip...]
```


```
# uname -a
FreeBSD x.x.x 8.3-RELEASE-p3 FreeBSD 8.3-RELEASE-p3 #0: Tue Jun 12 00:39:29 UTC 2012     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
```

I have already bootstrapped pkg, added the lines to my /etc/make.conf and run pkg2ng.


----------



## kpa (Mar 19, 2013)

Do not use pkg_version after switching to PKGNG, it does not work and it's by design.


----------



## dave (Mar 19, 2013)

kpa said:
			
		

> Do not use pkg_version after switching to PKGNG, it does not work and it's by design.



I only posted the output of pkg_version because SirDice asked for it.


----------



## SirDice (Mar 20, 2013)

Yes, I asked for it because it looks like you have a mix of 'old' and 'new' packages. Which is probably why the updating fails. Get rid of the old packages first.


----------



## dave (Mar 20, 2013)

SirDice said:
			
		

> Yes, I asked for it because it looks like you have a mix of 'old' and 'new' packages. Which is probably why the updating fails. Get rid of the old packages first.



I have never installed packages of any kind on this machine, only ports.


----------



## SirDice (Mar 20, 2013)

dave said:
			
		

> I have never installed packages of any kind on this machine, only ports.


They're essentially the same thing once they're installed.


----------



## dave (Mar 20, 2013)

SirDice said:
			
		

> They're essentially the same thing once they're installed.



OK.  Well, how do you propose I "get rid of the old packages first"?  I am trying to update my machine via portmaster.  The fail here is due to pkg.  The port install is succeeding, but pkg is failing after that and portmaster...?


----------



## SirDice (Mar 20, 2013)

First off, why are you using pkgng? It's rather pointless if you install from ports.

If you do want to use pkgng make sure you have WITH_PKGNG=YES in /etc/make.conf.

As for the old packages, try pkg2ng to convert them to pkgng. You're bound to get a lot of messages about packages already existing. Remove any old package that's left with pkg_delete(1).


----------



## dave (Mar 20, 2013)

SirDice said:
			
		

> First off, why are you using pkgng? It's rather pointless if you install from ports.
> 
> If you do want to use pkgng make sure you have WITH_PKGNG=YES in /etc/make.conf.
> 
> As for the old packages, try pkg2ng to convert them to pkgng. You're bound to get a lot of messages about packages already existing. Remove any old package that's left with pkg_delete(1).



I have 
	
	



```
WITH_PKGNG=YES
```
 in my /etc/make.conf.

I have run pkg2ng.  I noted this in my first post.

The reason I have some new and some old ports is because the error in my OP caused a portmaster run to fail.


----------



## SirDice (Mar 20, 2013)

dave said:
			
		

> The reason I have some new and some old ports is because the error in my OP caused a portmaster run to fail.


Wrong order. The build fails because you have some old packages.


----------



## dave (Mar 20, 2013)

With all due respect, SirDice, you are not being helpful.  Thanks for chiming in all the same.  Anyone else?


----------



## dave (Mar 20, 2013)

This solved my problem: http://forums.freebsd.org/showthread.php?t=38586


----------



## dave (Mar 20, 2013)

Ooops, I spoke too soon - same problem still.


```
===>   Compressing manual pages for zabbix2-agent-2.0.5
===>   Registering installation for zabbix2-agent-2.0.5 as automatic
Installing zabbix2-agent-2.0.5...pkg: zabbix2-agent-2.0.5 conflicts with zabbix-agent-1.8.15,2 (installs files into the same place).  Problematic file: /usr/local/man/man1/zabbix_get.1.gz
*** Error code 70

Stop in /usr/ports/net-mgmt/zabbix2-agent.
*** Error code 1

Stop in /usr/ports/net-mgmt/zabbix2-agent.

===>>> Installation of zabbix2-agent-2.0.5 (net-mgmt/zabbix2-agent) failed
===>>> Aborting update

===>>> Update for net-mgmt/zabbix2-agent failed
===>>> Aborting update

Terminated
===>>> There are messages from installed ports to display,
       but first take a moment to review the error messages
       above.  Then press Enter when ready to proceed.
```


----------

