Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Sep 2010 08:52:44 -0400
From:      Michael Powell <nightrecon@hotmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Upgrading packages - portupgrade confusion
Message-ID:  <i6iicg$9b3$1@dough.gmane.org>
References:  <4C8C0110.20801@gmail.com> <i6hb6t$s10$1@dough.gmane.org> <4C8CBADC.3070904@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Kaya Saman wrote:

> [...]

>> csup -L 2 ports && portsdb -uF && pkgdb -u && portversion

To elaborate a little. csup -L 2 ports is what refreshes the ports tree. 
Portupgrade is a third party app you can install to assist in automating the 
updating process. Once you've installed portupgrade there are man pages for 
portsdb, pkgdb, and portversion to see what the switches described above do. 
The commands above are just strung together to prepare a system for 
updating. portupgrade -a is actually what does the actual updating.

There are other tools as well, I'm just not as familiar with them. I think 
the other one is called portmaster. It may even be better, I don't know as I 
tend to stick with what I know as long as it keeps doing the job.  

[snip]
> 
> I didn't actually refresh the ports tree so I'm gona have to do that.
> 
> The thing I don't quite understand though is that if the ports tree gets
> refreshed, do the packages get upgraded or will I need to rebuild them??

I don't know if I can properly explain well enough, but I'll take a stab at 
it anyways. But I believe the first answer here would be no. Refreshing the 
ports tree does not install or update any installed software. 

I kind of keyed in on your mentioning of portupgrade. Portupgrade is a tool 
for automating the upgrading of installed software. While I believe it, and 
possibly portmaster can operate on pre-built packages I myself stopped using 
packages a long time ago. I compile everything.

A pre-built package is built from the same ports system that you would use 
if you were compiling locally yourself. It's just someone else has done it 
for you. The thing to know is that in either situation, e.g. pre-built 
package or compile it yourself the ports tree is where the versioning and 
dependency tracking happens.

There is more information in the Handbook, and probably presented better 
there than I can. It is spread out in several locations however. It may not 
be immediately apparent when reading the "How to install software" section 
that you also need to read the other sections further down that explain 
csup, portmaster, etc. The main thing we will keep reiterating though is the 
first step for updating installed apps is always refresh the ports tree 
first.
 
> I slightly recall the csup commnad, however I've never actually
> performed an inplace upgrade of a package in BSD. Only done this kind of
> thing in Linux - Debian/Ubuntu, CentOS and Solaris - OpenSolaris,
> Belenix where they have package managers.
> 
> What's the process for upgrading a package? make reinstall clean??
> 

Since I don't use packages my vantage point is centered around compiling 
locally myself. However, most of what I describe applies to both situations. 
Typically the first thing to do is update/refresh the ports tree. Should you 
determine something needs to be updated the manual approach would be to 
change to the directory of the app in ports system and do make, followed by 
make deinstall, and then make reinstall. The deinstall/reinstall leaves your 
configurations for installed apps in place.

Portupgrade is a tool that automates this. After refreshing the ports tree 
the portupgrade -a command will pretty much do what was described in the 
previous paragraph automagically. It isn't perfect and sometimes it hiccups. 
I've noticed that doing this more often so that only a few out of date apps 
need upgrading at any one time is smoother. It's when you have a hundred 
things that are really old and out of date because updating has been 
infrequent is when you are most likely to experience trouble.

Hope this helps. I'm not the best at explaining things, but the Handbook is 
a most excellent resource to be studied extensively. It is written much 
better than anything I can manage. And while much of it may seem cryptic at 
first glance, most of what you need to know is in there.

-Mike






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?i6iicg$9b3$1>