How to savely upgrade software from ports?

Roger Merritt mcrogerm at
Sun Apr 20 21:58:26 PDT 2003

At 10:22 AM 4/21/03, you wrote:

>I'm having trouble how to savely upgrade software to newer version in the 
>For example, "pkg_version -v | grep -v =" tells me:
>linux_base-7.1_2   <   needs updating (port has 7.1_3)
>I see two options, for this example:
>1) simply install 7.1_3 *without* deleting 7.1_2.
>2) delete with "-f" 7.1_2 and then install 7.1_3.
>    (this is what the "pkg_version -c" output suggests).
>Can someone tell me what are the pros and cons?
>Is there another (safer) way of upgrading?

Try running 'pkg_version -c > needs.update'. Then use your favorite editor 
to read "needs.update". You will find all the shell commands necessary to 
upgrade *all* your outdated ports, including the "pkg_delete" commands to 
remove the old packages. If you want to run this as a shell script you have 
to delete the first few lines, and you can delete the entries for any ports 
you don't want to upgrade at this time.

You can run the commands individually by just typing them in or run 'sh 
./needs.update', which will upgrade all your outdated ports. It takes a 
while if you have many ports, and some require interactive input, but it's 
a good system.

If you have "portupgrade" installed you can get a picture of what needs to 
be done by running 'portversion -c > needs.update' to get a shell script 
similar to the output of 'pkg_version -c'. You can then edit the script to 
remove entries for any ports you don't want to upgrade right now, or you 
could just run the command 'portupgrade -afr' (I've been told that you need 
the 'f' option for dependencies which are *not* outdated).


More information about the freebsd-questions mailing list