# pkg tries to install conflicting packages (and how to cron?)



## Cthulhux (Feb 2, 2014)

I use the lang/php55 port on my server, but also installed a couple of binary packages (via pkg).

Now what I type `pkg update ; pkg upgrade`, the package manager provides me to install lang/php5 for no known reason, of course that fails (due to the conflicts with lang/php55).

Where can I see what causes this weird proposal so I can stop it from making it?

-- While I'm at it: Does `pkg` feature a command to upgrade packages with a cron job?


----------



## ShelLuser (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

Well, I think this is a good example as to why you'd normally don't want to mix between packages which you build from the ports yourself and pre-made binary packages. Don't forget that the pre-made packages all use default values, and as such can easily clash with others.

Your best lead is to check which packages are affected with the `# pkg upgrade` command and then check their dependencies. My guess is that a dependency somewhere is what's causing all this.

But without knowing which packages we're talking about there's not much else to say about it.


----------



## Cthulhux (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

Is there a `pkg` parameter to check dependencies?


----------



## nanotek (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

`pkg query '%do'` $PACKAGENAME might do it.


----------



## Cthulhux (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

That returns a "69".


----------



## nanotek (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

What did you query?


```
# pkg query '%do' wget
security/openssl
dns/libidn
devel/gettext
```


----------



## Cthulhux (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

I tried with some PHP5 extensions. Seems like they don't depend on PHP5 itself.

Interestingly, my results vary.


```
# pkg query '%do' wget
dns/libidn
devel/gettext
```


----------



## nanotek (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

Probably because I have OpenSSL installed from ports; I installed it before upgrading to 10.0-RELEASE which has 1.0.1x in the base system now.


----------



## Cthulhux (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

Ah, I see.

So it's time to dig through all packages then. Thanks.


----------



## nanotek (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

Honestly, I can't believe I'm saying this: you might be better off converting to ports. If more than a few programs require specific build options, it might be best. I've started a test system on an old laptop where I'm installing everything with `pkg` except programs that require custom builds, so far I haven't had any problems but, for a live system, potentially avoiding headaches from conflicts might be worth the extra time lost to building from ports.


----------



## Cthulhux (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

I started using `pkg` to save some time. Probably I shouldn't.

I did a complete `pkg query` over all packages proposed by `pkg upgrade` and grep'ed them for "php5". None of them requires lang/php5, some require lang/php55.


----------



## bapt@ (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

Non of them requires php55 but the version on pkg.freebsd.org of some ports you have or want to install are depending on php5 because it is the default in the ports tree.  That is due to the faxt we do not support clever version like a port saying I need php what ever version it is.  We are able to provide such smart dependencies with pkgng, but cannot go that way until we remove support for the old tools ;(

My recommandation would be to run your own poudriere just to build those specific packages with pkg55 and activate a new repository with those packages, pkg annotate will allow you to say those specific packages should only come from your personnal repo and not from plg.freebsd.org


----------



## dpejesh (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

Am I wrong in assuming that according to this link that `pkg set` is suppose to allow you to override that dependency on lang/php5 and set it to lang/php55?  The wording and even the example make it seem like that's how it's suppose to work.


----------



## Cthulhux (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*

Seems to, but it doesn't "work":



> Conflict found on path /usr/local/lib/php/build/config.guess between php55-5.5.8(lang/php55) and php5-5.4.24(lang/php5)



(After having executed `pkg set -o lang/php5:lang/php55`.)


----------



## dpejesh (Feb 2, 2014)

*Re: pkg tries to install conflicting packages (and how to cr*



			
				Cthulhux said:
			
		

> Seems to, but it doesn't "work"


Oh, I know... I should have been clear about that.  I was directing the question to @bapt because without him we wouldn't have pkgng (which he deserves many thanks for) and since he was here I figured he'd know if it was an actual bug or if the documentation was misleading.


----------

