# Port upgrade (update?) confusion



## SeaHag (Feb 10, 2010)

I'd like someone to clear up the confusion with updating, or is it upgrading ports. 

1. First, what is the difference between "updating" a port and upgrading" a port?

2. There are so many utilities for maintaining ports, portsnap, portupgrade, portmaster. Which one should we use? I think portmaster is the latest and greatest so that's what I'm using. 

3. If using portmaster do we still need to do portsnap fetch update? or is that just for portsnap?

4. If using portmaster do we still need to do pkgdb to update the ports database or does portmaster not use either portsnap fetch update or pkgdb.

5. If I want to reinstall a port do I go to the port directory and type make deinstall then make install clean? Or just do portmaster <portname>?


----------



## SirDice (Feb 10, 2010)

Update or upgrade, for some people both mean the same thing 

But you basically _update_ your ports tree. To do that you can use portsnap or csup. Portsnap is probably the easiest to use. Both end up doing the same thing, namely updating the files in /usr/ports/.

You _upgrade_ a port if you go from a version 0.1 to 0.2 i.e. To install and/or upgrade ports (aka 3rd party software) you can use portmaster or portupgrade. Both are great tools if you know how to use them. I've used portupgrade for many years and have recently switched to portmaster. The reason was simple, portmaster has no dependencies. It uses the standard pkg_tools to keep things organized. Portupgrade uses a database to keep track. This database can be a little unforgiven at times 

Keep in mind that the "ports tree" is only a bunch of files that tell the system how to fetch and build a piece of external software. The external software is what's known as a port. To uninstall a port you should use pkg_delete(1). Use the *-x* option to make life a little easier. Or if you have portupgrade installed you can use pkg_deinstall(1).


----------



## DutchDaemon (Feb 10, 2010)

1. They're interchangeable when it comes to ports (installed applications); when talking about the ports _tree_ (/usr/ports), it's usually 'updating'.

2. Hold it: *portsnap* is used for keeping the *ports tree* (/usr/ports) up to date; *portupgrade*, *portmaster* and *portmanager* are used to keep *installed ports* (the stuff listed in [cmd=]pkg_info[/cmd]) up to date. Use what you like best; portupgrade and portmaster are the big players, and portmaster is the leanest and simplest of the two.

3. See 2 - they're not the same things; you'll always need *portsnap* for updating the *ports tree*. You''ll need one of *portupgrade*, *portmaster* or *portmanager* to update your *installed ports*.

4. portmaster needs no database, it uses the available data on the fly; portupgrade uses a database, and tools like pkgdb. Portsnap, again: entirely different thing.

5. Reinstalling a port is indeed easy with portmaster; just run [cmd=]portmaster category/port[/cmd], e.g. [cmd=]portmaster www/apache22[/cmd]. If Apache is not installed, it will be; if it is installed, it will be reinstalled. For an already installed port you can also use [cmd=]portmaster <port>[/cmd] (where <port> is the name showing up in [cmd=]pkg_info[/cmd]). If you want to get rid of it, use [cmd=]pkg_delete <port>[/cmd].


----------

