Mix'n'match between packages an ports?

Mike Clarke jmc-freebsd2 at milibyte.co.uk
Tue Jun 30 17:01:34 UTC 2015

On Tue, 30 Jun 2015 13:53:03 +0200
Ewald Jenisch <a at jenisch.at> wrote:

> Here's my question: Is a "mix and match" between binary and
> source-installation (pkg.. vs. "make / portupgrade") possible on the
> same machine, or is it one or the other?

It can be done, but with care.

I currently have 2 ports which need building from source due to needing
non-standard configuration and 2 more which aren't available as

As others have suggested poudriere is one way to go. I have tried this
and it's certainly an excellent product but for my case, where only a
very small number of ports required building from source, it was rather
like using a sledgehammer to crack a nut.

It's important that you keep your ports tree in step with the FreeBSD
repositories and, as has already been said, it can be a bit more
complicated now that the packages aren't built on a fixed schedule. The
solution is to use Reed Cartwright's sync-ports script
<https://gist.github.com/reedacartwright/8622973baf89b263a6d7>. This
will obtain revision information from the relevant build server and use
svnlite to update your ports tree to match the same version.

My updating procedure is as follows:

pkg lock -l   # To check that the ports you build from source are
              # locked - lock them if not.


make -C /usr/ports index

pkg updating | less   # To check for possible issues.

pkg upgrade

pkg version -vIL=     # If any of your locally built ports need
updating they will show up here

# If one of your ports needs rebuilding run
pkg unlock the_port_name
portmaster the_port_name
pkg lock the_port_name

By upgrading packages before attempting to rebuild any ports you ensure
that all dependencies will be up to date and you won't need to build
any of them unless the new version has acquired any new dependencies
since the last upgrade.

The same procedure applies for ports which aren't available as
packages, except that you don't need to bother about locking them.

I've been using this procedure for over 3 months now and not had any

Mike Clarke

More information about the freebsd-questions mailing list