portmaster installation trampling on my binary packages???

Kevin Oberman rkoberman at gmail.com
Sun Mar 19 19:54:20 UTC 2017


On Sun, Mar 19, 2017 at 11:35 AM, Ethan Grammatikidis <eekee57 at fastmail.fm>
wrote:

> Hi. I'm quite new to FreeBSD. I'm getting a system up & running slowly,
> working around my chronic fatigue. Today I'm updating for the first time.
> Base system and pkg update appeared to go well. I haven't rebooted, wanting
> to get everything done before reboot.
>
> https://www.freebsd.org/doc/handbook/ports-using.html
> This handook page says "ports-mgmt/portmaster is a very small utility for
> upgrading installed ports. It is designed to use the tools installed with
> the FreeBSD base system without depending on other ports or databases."
> That sounds just fine to me, so I did the usual to install portmaster, cd
> to its directory, and make install clean.
>
> So far, so good. Then I ran portmaster -a, and it all went pear-shaped. I
> found myself looking at an endless stream of dialogs; compile-time options
> for things I don't remember installing as ports. Assuming they're
> dependencies of some port I installed I accept this, but I'm puzzled
> because I only remember installing one port (devel/plan9port), and I
> thought it only built itself and maybe one dependency.
>
> Then it got disturbing: I get a dialog for *xorg* compile-time options. I
> installed xorg with pkg, a binary package, not a compiled port. I was
> briefly uncertain, my memory isn't very good, so I checked this:
> # date -jr `pkg query %t xorg`
> Sat Mar 11 21:32:41 GMT 2017
>
> What's going on? Is it going to build xorg and all these dozens of other
> ports too? If so, what about the binary packages I installed? Will they be
> overwritten? When I installed that one port, it didn't see the need to
> compile xorg from ports then, so why is it asking me about xorg compile
> time options now? Why is it asking me to configure literally dozens of
> other ports I don't care about? That question goes double if it's NOT going
> to install any of these ports.
>
> Most of all, why is this massive drain on my energy happening when all I
> did was ask for the installation of something described in FreeBSD's
> official handbook as "very small"?
>
> It's now sitting waiting for me to select bash compile time options, a
> shell I do not care about AT ALL. If it's installed, it's a binary package
> as a dependency of some other binary package. Can I safely ^C this? Is
> portmaster normally this insane? If so, why does the handbook recommend it?!
>
>
> There have been a couple of strange incidents with the ports tree prior to
> this. I installed from dvd, selecting to install the ports tree at that
> time. This took long enough that it looked like the biggest part of the
> installation. When I tried to install that one port, it told me it needed
> to fetch the port tree. I thought this bizzarre, but ran the suggested
> command anyway, and after that the port installed just fine. Today I refer
> to the handbook, and it recommends upgrading the tree using portsnap. Fine,
> I accept this recommendation... and portsnap then proceeds to whine that it
> can't work with the default ports tree, it needs *it's* version. (Why is it
> part of the base system if it can't use the default tree?) After a couple
> of aeons waiting for portsnap to do its thing and then mk clean just in
> case I'd installed something else and forgotten about it, I then installed
> portmaster and tried to use it with the results described above.


I think you need to understand the relationship between packages and ports.
First and foremost, they are the same thing. When you build a port you are
actually creating a package by processing the source files. This usually,
but not always means compiling, linking, creating libraries, often both
shareable (.so) and static (.a), installing documents, etc. This is done in
a process called staging. The staged port is then packed into a package and
the package is installed. This package is the exact same package that is
installed by using pkg install, except that it is created locally from the
sources instead of being downloaded from a repository.

When you run 'portmaster -a', you are telling the system to go through
every installed port and confirm that it is the same version as that
installed. If it is not, regardless of whether it was installed by building
the port or by downloading and installing the binary package, portmaster
will build and install the new port, replacing the old port.

If you have installed from the packages included in a FreeBSD distribution,
they are the packages existing at the time of the release. In many cases,
this is a LOT of packages as they are continually updated as needed. (Some
not very often and others as often as every week or two.) So hte first time
you run 'portmaster -a', you will build and re-install a LOT of things and,
since the pre-built packages are all built using the default build option,
you may get a lot of configuration screens where you can choose non-default
options. These options will be saved and future updates will not ask again
until the options are changed, a far less frequent thing. Again, the
initial run of portmaster is at least "tedious".

My question must start with "Do you have a reason to build from sources?
You do if you need non-default options, but otherwise that is likely not
needed and extremely time consuming. Instead you can jsut use packages and
install the pre-built binaries. Y0ou don't even need to have ports on you
system.

Here is what I do for most systems:
If any ports require non-default options, and few will, use "pkg lock
PACKAGE-NAME" so pkg will not attempt to update the port from binaries.
Then I run 'pkg upgrade' regularly. This will update any ports that have
been modified since you installed your system. Because it installed binary
packages, it is quite speedy. Then, I run 'make -C /usr/ports fetchindex'
to get the latest index of ports and then 'pkg version -vL=' to check on
whether any locked ports need to be touched. (As I have no more than 2 such
ports 0n any system, this is pretty infrequent.) If you don't have any
ports that need to be built from scratch, you can skip this and not even
worry about the ports.

the other issue is whether you want to keep all ports right up to the
latest update. There are two sets of packages built for every release. One
is "latest" and the other is "quarterly". 'quarterly' is only updated four
times a year or for security fixes. 'latest' is continually updated. Most
people probably are fine running with quarterly. It results in a lot less
churn and fewer cases of being bitten by buggy updates. (Yes, they do
happen.)

I strongly urge that you read the sections of the FreeBSD Handbook
<http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/> , especially
the section on ports and packages, Section 4. It should clarify a lot and
make things simpler.
--
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman at gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683


More information about the freebsd-ports mailing list