Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Mar 2005 22:00:58 -0500
From:      Bob Johnson <bob89@bobj.org>
To:        freebsd-questions@freebsd.org
Cc:        "N.J. Thomas" <njt@ayvali.org>
Subject:   Re: greetings from FreeBSD DLL Hell!
Message-ID:  <200503232200.58849.bob89@bobj.org>
In-Reply-To: <20050324011607.GA1199@ayvali.org>
References:  <20050324011607.GA1199@ayvali.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 23 March 2005 08:16 pm, N.J. Thomas wrote:
> I installed FreeBSD 5.3-RELEASE and was installing packages via "pkg_add
> -r foo". This worked, but it went and downloaded older versions of
> various programs (i.e. Mozilla Firefox 0.9). How can I tell pkg_add to
> use the "5-latest" (5-STABLE? RELENG_5_3?) branch? Do I have to update
> my sources before I can do this?

By default, pkg_add uses the packages that were built for your release (so 
everything is consistent).  As a result, when your release 
gets to be a few months old, so do the packages.

One approach to solving your problem is to go to 
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/All/ and 
download the package you want, then install it with pkg_add.  

Another is to set the appropriate environment variable to tell pkg_add to use 
that URL as the location from which to automatically fetch packages (I don't 
remember the variable, try to decipher the man page).

That said, the solution I usually use is to upgrade everything from ports 
rather than packages.  One way to accomplish this is to install the 
portupgrade port, then use it to upgrade a port/package and everything it 
depends on:

First, install portupgrade.  Then cvsup your ports collection so it is as 
recent as possible, then fetch the updated index so you don't have to wait 
for your system to build one:

# cvsup ports-supfile
# cd /usr/ports
# make fetchindex

then upgrade the ports that need upgrading:

# portupgrade -R portname

This will upgrade (from source) the port (or package) named portname, as well 
as all ports that it requires.  There can be some glitches with this method 
on some ports, so read the man page and look at the examples it gives.  
Sometimes a dependency won't update automagically and you will need to 
portupgrade it separately, then go back and issue the top-level command again 
and let it pick up where it left off.  This method can take a very very long 
time if something big gets rebuilt from source.

You can also tell portupgrade to install packages rather than ports.  I 
believe portupgrade uses the PKG_FETCH environment variable to tell it where 
to fetch packages from, so set it to the ftp URL above and you should get the 
latest packages, e.g. in bash, something like
# export PKG_FETCH ftp://(etc) ; portupgrade -RPP portname

You can even upgrade every package/port installed on your system with 
something like 

# export PGK_FETCH ftp://(...) ; portupgrade -RrP *



The portmanager fans out there will tell you it is easier to use portmanager 
than portupgrade, but I've never used it, so you'll have to wait for their 
suggestions.


>
> So after I installed 5.3 yesterday I installed some packages with
> pkg_add -r (which used the 5.3-RELEASE versions of the software), and
> then installed some other stuff with ports, and then updated ports with
> cvsup and then installed yet some more stuff, and now I seem to find
> myself in the FreeBSD equivalent of "DLL Hell". Should I just blow my
> system away and start from scratch? Is that the best course of action to
> take at this point?
>

What do you mean when you say you are in DLL hell?  Is something actually not 
working right?  FreeBSD is pretty good about managing libraries.  It should 
not be a problem to have multiple versions of the same library; different 
programs will use the version they were built for.  This may not be true for 
Linux ports, though (not sure).

Anyway, any (or a combination of) the methods I described above should be able 
to get everything straightened out after you fix the parts I likely 
remembered wrong.

> thanks,
> Thomas

Good luck.

- Bob



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