# basic ports/packages questions



## maudib (Mar 28, 2012)

Hi,

*I* googled around trying to find some documentation on maintaining FreeBSD systems that have a lot of ports and a lot of packages installed and didn't find anything. It was my understanding that a 

```
#portupgrade -ai
```
 would always take care of all your ports and reinstall any outdated packages, and make it so that you never had a broken system? Is this actually true? (just to be sure before *I* bring them all up to date).

The thing that made me question this was something on a wiki that said that the -a option, to portupgrade, is not recommended. Does portupgrade really solve all dependency problems, i.e the build will fail if you try to install two different versions of the same port? With a lot of ports isn't a portupgrade of all of them a bad idea?

I know you're supposed to read /usr/ports/UPDATING. You're supposed to work out the right order of the portupgrade commands to run by reading this file right? Also what about packages? Will the dependency tracking of binary packages and the dependency tracking in the ports system work together? If you are not supposed to have two different versions of the same port installed what about two different versions of the same software, one installed from packages and one installed as a port? That doesn't matter right? Or does it just mean that the last one installed was installed over the old one? I mean installing a newer version of a binary package will just install automatically the latest version of the package and install it over the old one? But this will mean that if you want to install some larger packages from packages a:
	
	



```
#portupgrage -ai
```
 is NOT a good idea? If not how are you supposed to maintain systems with many packages installed, some from the ports system and some as packages? 

Any advice would be great. Thank you for any replies


----------



## SirDice (Mar 28, 2012)

maudib said:
			
		

> It was my understanding that a:
> 
> ```
> #portupgrade -ai
> ...


No, it's not foolproof. Normally this isn't a problem but you must read /usr/ports/UPDATING. Sometimes updating MUST be done in a certain order.


----------



## maudib (Mar 28, 2012)

Hi,

Thank*s* for the reply. What about managing systems that have, say, large packages installed through packages (like Xorg and KDE4) and lots of other software installed through ports? Is there a way of doing a 

```
#portupgrade -ai
```
 but excluding the software installed through packages in the update? They are supposed to be managed separately, i.e does the dependency tracking in ports take your packages into consideration and visa-versa?


----------



## SirDice (Mar 28, 2012)

You need to realize that once installed there is no difference between a package or a port. A package is simply a pre-compiled port.


----------



## DutchDaemon (Mar 28, 2012)

And a portupgrade doesn't do much without updating the ports tree first. Just to make sure you don't overlook that basic step..


----------



## maudib (Mar 31, 2012)

Am *I* right in thinking that, for a workstation with Xorg and Gnome2 installed, a safe and easy first step getting all the non-base software up-to-date is:

```
# pkgdb -Fu
# portupgrade -RarPb -x Xorg -x Gnome2
```
?
Can exclusions break the system, *in some cases* (if you forget the -b option)? Or, if you use the -x option might you be left with a system that is in a non-ideal state due to dependency issues? 

Thank you very much for your replies.
regards


----------



## SirDice (Apr 2, 2012)

The safest option is to read /usr/ports/UPDATING and follow any instructions that might apply to your system.


----------



## maudib (Apr 6, 2012)

Thanks for all the replies.


----------

