# Ports question



## Lido (Dec 17, 2011)

I just installed FreeBSD 8.2 RELEASE a few weeks ago and I could use some help about keeping the ports up to date. I've been using
	
	



```
# freebsd-update fetch
# freebsd-update install
```
 to keep the base system up to date with security patches (though there haven't been any after the first couple of days after I first installed).

I was using
	
	



```
# pkg_version -v
```
to see what ports needed updating and then
	
	



```
# portupgrade -a
```
 to update them. The problem was that a lot of packages were not getting updated because of various errors, mostly the "because it is held by user (specify -f to force)" one.

So I decided to try portsnap to see if that would help.
	
	



```
# portsnap fetch update
# portsnap extract
```
That took a long time to finish running and when it finished, I ran 
	
	



```
# pkg_version -v
```
 again and it seemed like there are way more ports now than there were before and many more of them needed updating.
	
	



```
# pkg_version -v | wc -l
     209
```
Does that seem right or did I do something wrong?

The original problem didn't go away either: 
	
	



```
# portupgrade -a
```
doesn't update them and when I pick one individually, like say apache for example, it exits with a random build error. The manual is great, but I'm having trouble understanding the ports system.


----------



## wblock@ (Dec 17, 2011)

portsnap(8) doesn't update the applications that have been installed from ports, it updates the ports tree (/usr/ports).  So when pkg_version(1) compares the installed versions to what's now available in the ports tree, it sees more.

Also, don't use extract every time with portsnap, only do it the first time.  It takes a long time.

This article covers the basics: Upgrading FreeBSD Ports.


----------



## Lido (Dec 17, 2011)

Thanks. Is there a way to get a similar list of ports that need updating that only shows the installed ports?


----------



## SNK (Dec 17, 2011)

`% pkg_version -IvL '='`

Try the above.

-edit-

You might want to take a look the following script: http://forums.freebsd.org/showpost.php?p=39092&postcount=37


----------



## wblock@ (Dec 17, 2011)

Lido said:
			
		

> Thanks. Is there a way to get a similar list of ports that need updating that only shows the installed ports?



That's what it's showing already.  I prefer the portmaster version shown in the article, though.


----------

