Hi,
I am quite new to FreeBSD, so please excuse, if this is a FAQ, but unfortunately my research so far hasn't made me 100% happy and so I decided to try here
Most of my packages are pkg installed binaries, yet some are ports based.
In general, I am aware how to keep both pkg based and ports based packages up to date, but unfortunately I fail to understand, how to prevent pkg based updates from breaking my ports packages.
So lets assume that all but one packages are pkg based and I want to update my pkg based packages.
Situation *before* update:
PackageA:
- installed from ports, version 1.0
- pkg knows the package as well, with version 1.0
Let's assume that sometime after my last update, a new version 1.1 of PackageA is published to the pkg repositories.
If I later decide to update my system, I run:
Among the other updates, this would install PackageA version 1.1 from the binary repositories, which is exactly what I need to prevent.
From http://unix.stackexchange.com/questions/110167/how-to-update-a-mix-of-packages-and-ports-on-freebsd I learned, that the best way to prevent Package A from being updated by pkg seems to be to lock it using
This works to a certain degree, but unfortunately this locks the package for any other ports oriented tool as well (like portupgrade) and they complain, that the package is locked.
While unlocking it and rerunning portupgrade again might work for one or only a few packages, it becomes difficult, if you have a significant number of ports based packages that you had to unlock each time you update.
So can I configure pkg not to interfere with my ports based packages and vice versa?
I am quite new to FreeBSD, so please excuse, if this is a FAQ, but unfortunately my research so far hasn't made me 100% happy and so I decided to try here

Most of my packages are pkg installed binaries, yet some are ports based.
In general, I am aware how to keep both pkg based and ports based packages up to date, but unfortunately I fail to understand, how to prevent pkg based updates from breaking my ports packages.
So lets assume that all but one packages are pkg based and I want to update my pkg based packages.
Situation *before* update:
PackageA:
- installed from ports, version 1.0
- pkg knows the package as well, with version 1.0
Let's assume that sometime after my last update, a new version 1.1 of PackageA is published to the pkg repositories.
If I later decide to update my system, I run:
pkg update
pkg upgrade
Among the other updates, this would install PackageA version 1.1 from the binary repositories, which is exactly what I need to prevent.
From http://unix.stackexchange.com/questions/110167/how-to-update-a-mix-of-packages-and-ports-on-freebsd I learned, that the best way to prevent Package A from being updated by pkg seems to be to lock it using
pkg lock
.This works to a certain degree, but unfortunately this locks the package for any other ports oriented tool as well (like portupgrade) and they complain, that the package is locked.
While unlocking it and rerunning portupgrade again might work for one or only a few packages, it becomes difficult, if you have a significant number of ports based packages that you had to unlock each time you update.
So can I configure pkg not to interfere with my ports based packages and vice versa?
Last edited by a moderator: