Same version on binary packages and updated ports

Polytropon freebsd at
Thu Dec 29 17:55:35 UTC 2011

On Thu, 29 Dec 2011 17:16:11 +0100, Walter Alejandro Iglesias wrote:
> Hello,
> I am giving my firsts steps with FreeBSD.
> I've searched a lot in google, mailing list, forums, freebsd
> handbook and I am still not clear about the following.
> In a RELEASE fresh install, after updating the ports using i.e.
> portsnap, the packages downloaded with pkp_add -r are older
> versions respect their port counterparts, leading to
> dependencies issues.  So, once the ports tree is updated:
> 1) Am I forced to compile all?

No, you aren't forced to anything. :-)

In case you intend to bring your _installed_ programs
up to date (where "date" is indicated by the ports
tree), use a tool like portmaster or portupgrade to
upgrade all that need upgrading.

> 2) Should I use STABLE to get the same versions with pkg_add
> than compiling up to date ports? 

RELEASE and STABLE are related to the OS, not to the
3rd party applications found in the ports tree. If
to use RELEASE (with -p<number> security patches)
or following STABLE depends on your requirements.
OS and installed applications are independent (mostly).

> Are STABLE packages compiled
> from this ports?

Yes. From time to time, a "snapshot" of the (continuously
evolving) ports tree is used to build the binary
packages. _Which_ set of packages will be requested
by running "pkg_add -r <name>" depends on $PACKAGEROOT.

For example, if it is set to
it will use the latest packages (which are slightly
behind actual ports in most cases).

But if
is used, the packages of RELEASE will be used, such as
you can find them on the installation media

> 3) In case my assumption above is correct; taking in care that
> in a production system it is advisable (handbook) to stay with
> RELEASE, should I avoid updating the ports tree in i.e. a server
> machine? 

That depends on the usage profile of that system.
You should keep track of _any_ security issues you
might have with the ports you use (e. g. web servers,
PHP, MySQL and other "potentially dangerous" stuff).
You can use freebsd-update to follow RELEASE-p<number>
to get the security updates for the RELEASE you are

If you don't update the ports tree, it will stay at
the date of RELEASE, delivering ports from exactly
that date. It's often the better choice to update
the ports tree and upgrade ports that need this
(as I said before, primarily for security reasons,
as you did mention a production system, where
"bleeding edge" is often _not_ desired).

> What to do with broken ports in this case?

The RELEASE tree typically doesn't contain broken
ports. If an updated ports tree does, update it
again soon and try again. :-)

In contrast to portsnap, you can use the "classic
approach" of using csup to update your ports tree.
For smaller deltas, this is acceptable, and it will
deliver you the "freshest" ports tree available.

> Resuming, is there a default way to install-update the software
> keeping ports and binary packages in one piece? 

I don't think so. The desired method depends on your
actual usage requirements. I'd suggest to have a look
at a port management tool such as portmaster or
portupgrade, as both can handle both building from
source and using precompiled binary packages, and
keep track of dependencies and automated upgrades.

> What is
> advisable in general terms for a desktop and what for a server?

Also depends on your usage model. For example, my
home system is a kind of "install once, then keep
using" installation. I'm running 8.2-STABLE and
ports from an updated tree. For a server, this
approach might not fit - maybe you want to keep
all things binary there, or from source only.

> It will be enough for me if someone just point me to documentation.

The FreeBSD Handbook. :-)

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list