# pkg vs portmaster



## idude (Apr 21, 2017)

Hello,

There are some software that I would like to install via ports and others that I just to add via pkg, can these two conflict in anyway at some point or is it perfectly ok to do it?


----------



## usdmatt (Apr 21, 2017)

The unfortunate answer is, it depends..

Using FreeBSD 10 as an example, all the packages are currently built on 10.3. If you look at /usr/ports/Mk/bsd.default-versions.mk you'll see the default versions for a large number of ports.

Now here's where it becomes an issue.

The other day I installed mysql5.7, nginx & php7.1 from pkg. No problem. However, when it came to installing pear (which I needed for a specific application), the port relies on php. Because the packages are currently built with php5.6 as the default version, it was built against php5.6 and wanted to remove php7.1 and install php5.6 instead.

While I was perfectly able to install php7.1 from packages, I had to override the default php version by adding `DEFAULT_VERSIONS += php=7.1` to /etc/make.conf and build pear by hand (using the port). There would be no way to install the official package without it demanding I use php5.6.

So basically, in general there's no issue with mixing ports and packages. When you install a port all that happens is you locally create the package, and then install that package. However you may see issues when you install a package or port that depends on something else you've already installed, and the version the package/port depends on is not the version you installed.


----------



## scottro (Apr 21, 2017)

By default, packages use the quarterly version. (You can change that to using the latest by creating a file.  See https://forums.freebsd.org/threads/54608/#post-311381)

If mixing is necessary, I would recommend using latest, rather than quarterly for packages, but I think just about everyone gets bitten sooner or later.


----------



## nickednamed (Apr 21, 2017)

scottro said:


> If mixing is necessary, I would recommend using latest, rather than quarterly for packages, but I think just about everyone gets bitten sooner or later.



I'm tracking both the quarterly pkg repo (default) and the quarterly ports tree (via svn), which means I don't get so many updates, just security fixes - therefore less building of packages (be sure NOT to use portsnap AND svn to keep your ports tree up to date).

I was mixing packages and ports, but I had a few issues (portmaster, synth, and pkg all wanted to install different dependencies and some complained that things that were installed weren't installed, and vice versa).

Now I use only ports-mgmt/synth and build my own local repo (ports-mgmt/portmaster works well too). Both can download packages for which there is no reason to build from scratch IE the port options have not been changed, and the port / package are both of the same age.

Tracking the quarterly repo and ports tree, plus downloading packages (when possible) will save a lot of time.[/port]


----------

