# portupgrade -a



## epanagio (Oct 13, 2012)

After updating the ports with portsnap I am having a tough time updating the ports. I issue "portupgrade -a" but the command is not found. How do I update the ports? I don't want to mess the server up and I am confused by the portupgrade -a command.


----------



## wblock@ (Oct 13, 2012)

Did you install ports-mgmt/portupgrade?  Then use rehash in the shell.  See
`% man csh | less -p rehash`

And be warned that using -a without reading /usr/ports/UPDATING first is a common cause of problems.


----------



## gkontos (Oct 13, 2012)

After reading /ports/UPDATING and following specific instructions for your ports if needed, you will be better off using:

[CMD=""]# portupgrade -arR[/CMD]


----------



## wblock@ (Oct 13, 2012)

-arR, also known as "pirate mode", is no different than -a.


----------



## gkontos (Oct 13, 2012)

wblock@ said:
			
		

> -arR, also known as "pirate mode", is no different than -a.




```
-r
     --recursive            Act on all those packages depending on the given
                            packages as well.

     -R
     --upward-recursive     Act on all those packages required by the given
                            packages as well. (When specified with -F, fetch
                            recursively, including the brand new, uninstalled
                            ports that an upgraded port requires)
```

It is very different and it has saved me a lot of times when a ports dependencies have also been modified.

It is not like ports-mgmt/portmaster


----------



## Majorix (Oct 13, 2012)

I would suggest using pkgng instead, but ONLY if NOT on -CURRENT.


----------



## wblock@ (Oct 13, 2012)

gkontos said:
			
		

> ```
> -r
> --recursive            Act on all those packages depending on the given
> packages as well.
> ...



After having used portupgrade for something like a decade, I'm more likely to confuse options the other way around. 

-a means "all packages".  It will sort them in dependency order.  Because of that, -arR is equivalent to -a.  If you don't use -a, and much of the time it's better left out, -r and -R make a difference.


----------



## randyqx (Oct 15, 2012)

Majorix said:
			
		

> I would suggest using pkgng instead, but ONLY if NOT on -CURRENT.


uh, how and why does one stop it from doing so?


```
/usr/src# uname -a
FreeBSD ran.psg.com 10.0-CURRENT FreeBSD 10.0-CURRENT #12 r238467M: Sat Sep 15 10:53:45 UTC 2012     root@ran.psg.com:/usr/obj/usr/src/sys/RAN  amd64

/usr/src# portupgrade --batch -av 2>&1 | tee portupgrade.log 
USING PKGNG
```


----------



## randyqx (Oct 15, 2012)

i suspect that the why of why one wants to prevent pkgng from running is that it hangs.

```
root     46060  0.0  0.3  34072 12364  1  T    11:54PM     0:00.02 /usr/sbin/pkg query %do %dn-%dv ImageMagick-nox11-6.7.6.9
```


----------



## epanagio (Oct 15, 2012)

*Oy!*

After updating the ports I had the great idea of rebooting the server. Why, why! Now the server is hung and I am waiting for the technology crew to com in on Monday. I hope it will boot again or I am in trouble.


----------



## wblock@ (Oct 15, 2012)

Did you read /usr/ports/UPDATING and do what it said first?  Have you changed root's shell?


----------

