mixing binary packages and compiled ports - keeping it up to date

S66

New Member

Reaction score: 1
Messages: 4

Setting:
  • FreeBSD 11.0 RELEASE
  • I have binary packages installed using pkg. Works great and fine in itself.
  • I have installed from source some ports as the options used in the binary version was not what I needed. Works great and fine in itself.

Mixing both as such works as advertised, but I'm not sure how to keep it up to date in a safe manner so that the vital compile time options remain set on those ports that need it.

I know I can prevent pkg upgrade from upgrading an installed from source package to a binary one by locking it with pkg lock <name>. That works fine.

But that also means that portmaster <name> doesn't want to update it either anymore, giving a long error message. I can go in the appropriate /usr/ports/... directory and do a manual make reinstall, which does work, but then the lock seems to be gone all of a sudden, risking that pkg upgrade would start to put its binary version out there.

Question is hence simple:
How do I set it up so that:
  • The binary installed packages keep getting binary upgrades
  • The packages compiled from source with a different set of options can be upgraded with a simple command that doesn't require a truckload of additional software to be installed
  • Keep that going forward so that the compile time option I need are never going to be overwritten by a binary version that has other options.

E.g. of a package I need to make from source: nginx ...
 

xtaz

Well-Known Member

Reaction score: 142
Messages: 472

Ideally the way you should do this is to use a package builder such as poudriere or synth and use them to build your local packages from a list. Keep your local ports tree at the same revision as the FreeBSD package repository was built from and then install the packages from each repository as required. pkg will automatically record which repository the packages came from and update from each as needed.

If you don't keep the source tree revisions identical then you run the risk of installing a package which depends on a package that doesn't exist.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,298
Messages: 38,811

If you don't keep the source tree revisions identical then you run the risk of installing a package which depends on a package that doesn't exist.
It doesn't matter what /usr/ports contains if you install packages (using pkg-install(8)). It can even be completely empty.
 

Trihexagonal

Son of Beastie

Reaction score: 2,405
Messages: 2,930

Setting:
  • FreeBSD 11.0 RELEASE
  • I have binary packages installed using pkg. Works great and fine in itself.
  • I have installed from source some ports as the options used in the binary version was not what I needed. Works great and fine in itself.

Mixing both as such works as advertised...

It's recommended not to mix ports and packages. Stick with one or the other and you'll find peace within.
 

xtaz

Well-Known Member

Reaction score: 142
Messages: 472

Nothing wrong with mixing ports and packages. After all the only thing installing a port does is creates a package which is installed using pkg. What isn't recommended, and what I mentioned above, is mixing two different versions of the ports tree. As you might install a port that's linked against say OpenSSL 1.0.1 but the package repository wants to install a package that's linked against OpenSSL 1.0.2. Then hassle ensues.

That's why I said the best option is to keep your ports tree in sync against the package repository and use something like poudriere to create your own second repository.
 
Top