Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 2009 15:01:23 -0800
From:      Charlie Kester <corky1951@comcast.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: Newbie questions (updating, ports, etc.)
Message-ID:  <20091203230123.GA4955@comcast.net>
In-Reply-To: <200912031113.39344.macerl@telkomsa.net>
References:  <200912031113.39344.macerl@telkomsa.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu 03 Dec 2009 at 01:13:39 PST Richard Mace wrote:
>I recently installed FreeBSD 8.0-RELEASE on my home desktop and am considering
>making the switch from Debian GNU/Linux.
>
>I have a few questions which I am hoping the list can clarify for me.
>
>1.) Keeping installed ports/packages up to date.
>
>As far as I can tell from the docs, perhaps the most convenient method is to
>use something like:
>
># portsnap fetch update
># pkgdb -F
># portupgrade --batch -aP     (do I need an "R" here?)
>
>which should first try to find a package from the repositories and failing that
>will fall back to a port. What is the current wisdom here?

As others have said, there are almost as many approaches to this as
there are users.

The approach I've been using is:

    portsnap fetch update

followed by 

    portversion -vL=

to see which of my installed ports needs updating.  If there are many of them,
I'll use

    portupgrade -ar
to update them all in one fell swoop.  But if there are just or two, or if
I know that some of them (like OpenOffice or KDE) are going to take a long time
to build, I'll specify the individual ports I want updated:

    portupgrade -r port1 port2 port3 ...

I don't usually install packages, because I want to optimize the builds
a little.  On an i386-class machine, the compiler defaults to using the
lowest common denominator instruction set, i.e., it doesn't use
instructions introduced by later versions of the microprocessor.  My
machine is an old Pentium3, and I'm trying to squeeze as much
performance out of it as possible.  So I have the following in
/etc/make.conf and always compile ports from source:

    CPUTYPE?=pentium3

Lately I've been looking at portmaster as a replacement for portupgrade,
because it's so often recommended on this list.

>
>Is it safe to use the --batch switch? As far as I understand, this will use
>the configuration defaults and not prompt the user whenever a port requires
>some user (options) configuration. Is this interpretation correct? Otherwise,
>is there a way to get portupgrade to use the defaults non-interactively, to
>automate the process.

I recently asked about this myself, while planning to do a complete
reinstall of all my ports following an upgrade to FreeBSD 8.0.

The --batch switch is quite safe, and your understanding is correct. But
you might find that your needs are better met by doing a preconfigure,
that is, by answering the config dialogs for all of the updating ports
before proceeding to the actual build of any of them.  portmaster does
this by default, and portupgrade has the --config switch.


>
>Related to the above, are the default options that appear in the
>ncurses dialogues the same as those used in the building of packages?

I would assume so, yes.

>
>2.) Evolution of ports (and packages) versus evolution of the base system.
>
>Reading the docs makes it clear that FreeBSD maintains is a rigorous
>distinction between the base system and add-on packages (ports). This is very
>appealing. However, as far as I can tell so far, even though my base system is
>8.0 -RELEASE (and remains fixed between releases?), the ports continuously
>evolve (are updated). Is my understanding correct that by tracking a RELEASE
>system I can have "bleeding edge" (or close) versions of ports? Or, do I need
>to track STABLE of CURRENT for that?

The correct answer is "Any of the above".  The base system and the ports
system are independent of each other, and evolve separately.  This means
you can combine any version of the portstree with any version of the
base system -- within reason, of course.  The base system guarantees
that its APIs will not be changed except when its major version changes;
this is why, for example,  all ports need to be recompiled when going
from FreeBSD 7.x to 8.0.  Otherwise, changes in the base system do no
affect the ports, and you can track RELEASE, STABLE or CURRENT as you
prefer, while updating ports as ofen as you like.

>
>3.) Upgrading ports seems to take considerable time (at least with my
>experiments on a 5 year old Pentium IV). I am keen to adopt FreeBSD as my
>desktop for work  (Physics Professor, Research and teaching). Is it feasible
>in a work environment to upgrade ports without getting bogged down in a
>compile-a-thon, leaving one with a useless workstation. (My target machine
>will be an 8-core HP z600 (Xeon) which leads me to believe that I could do the
>upgrading in the background while I continue to work uninterrupted. I'd like
>to hear others experiences here.)

As you can see above, my machine is an even older Pentium3.  ;-)

Compiling is what it is, and unless you're willing to accept the
shortcomings of packages, is a price that has to be paid.  I've found
that the best way to avoid a "compile-a-thon" is to spread the work out,
by updating my ports on a daily basis.  (As someone else pointed out,
you do NOT need to recompile each and every port every time! Just the
ones that are out of date.)

But I should also point out that FreeBSD, like most Unix systems,
does an excellent job of multitasking.  My old pentium3 is still
quite usable for other tasks, even while it's cranking on a compile
of the latest KDE.  Of course, I don't run any compute-intensive
scientific simulations or whatnot, so your mileage may vary. 

>
>Sorry for the long post, but I could not find clarification on the
>above in the Handbook and other sources I've read.

I can't speak for anyone else, but long posts don't bother me.  I hope
we've clarified things for you.  Welcome to FreeBSD!

-- Charlie



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091203230123.GA4955>