# Upgrading ports?



## mariourk (Dec 21, 2011)

What is the best way to upgrade installed ports?

I've been reading through this page and tried [cmd=]portupgrade -R pkg_name[/cmd] Something happenend, but the package I tried to update (courier-imap) was not updated, according to [cmd=]pkg_version -v[/cmd]

So I gave portmanager a shot and ran [cmd=]portmanager -u courier-imap[/cmd] Instead of just updating courier-imap, portmanager began to update *all* the outdated packages. And it compiled all of them, despite that I installed many of them with pkg_add.

I have a Gentoo background and I like to avoid compiling as much as possible. Unfortunately I have to compile a few packages, like Postfix, to include certain options. But I can live with that.

I would like to update the packages individually, so I can tell FreeBSD to fetch a package, or compile the package.

Tips and pointers on how to do this as efficient as possible are most welcome. 

P.S. despite the few bumps, I think FeeeBSD is going to be a winner for me :beergrin


----------



## Beastie (Dec 21, 2011)

mariourk said:
			
		

> So I gave _portmanager_ a shot and ran _portmanager -u courier-imap_ Instead of just updating courier-imap, portmanager began to updated *all* the outdated packages.


The portmanager() man page says:


> *Single port update* Updates a single port and all of its dependencies.
> Always put the switches after the port directory when using this option:
> example: portmanager x11/gnome2 -l -ui -f


----------



## SNK (Dec 21, 2011)

First look for a nearby and up-to-date mirror at http://www.freebsd.org/doc/handbook/mirrors-ftp.html.

Then, if you are using FreeBSD 9, replace your country and architecture below (using the above mirror) and run:

`#  echo "setenv PACKAGEROOT [url]ftp://ftp[/url].[COUNTRY].freebsd.org" >> ~/.cshrc`
`#  echo "setenv PACKAGESITE [url]ftp://ftp[/url].[COUNTRY].freebsd.org/pub/FreeBSD/ports/[ARCH]/packages-9-stable/Latest/" >> ~/.cshrc`

Install ports-mgmt/portmaster and ports-mgmt/portaudit.
`# pkg_add -r portmaster`
`# pkg_add -r portaudit`

Run this script: http://forums.freebsd.org/showpost.php?p=39092&postcount=37

Then update the ports, e.g.:
`# portmaster -dbvP <category>/<portname>`
`# portmaster -aP`

Also read portmaster(8), and always read /usr/ports/UPDATING.


----------

