# HOWTO: Check for Port Updates



## AntumDeluge (Jan 22, 2015)

Here are a couple of ways to check for Ports with new updates available using commands in a terminal. The first method uses portsdb and portversion which can be installed from ports-mgmt/portupgrade (my preferred method) and the second uses portmaster (ports-mgmt/portmaster).

To install portsdb and portversion:

```
# cd /usr/ports/ports-mgmt/portupgrade && make install clean
```
To install portmaster:

```
# cd /usr/ports/ports-mgmt/portmaster && make install clean
```
Using portversion:

1. Update the Ports tree:

```
# portsnap fetch update
```
2. Update the Ports database:

```
# portsdb -Uu
```
3. List all available updates

```
# portversion -vl "<"
```
Using portmaster:

1. Update the Ports tree:

```
# portsnap fetch update
```
2. List all available updates:

```
# portmaster -L | grep -i "new version"
```


----------



## gkontos (Jan 22, 2015)

I have this in my crontab. Very useful, because I get a daily email if there is a need for an upgrade:


```
0 3 * * * root portsnap -I cron update && pkg version -vIL=
```


----------



## SirDice (Jan 22, 2015)

Keep in mind that there's likely always something to update as the ports tree is in constant motion. The daily periodic(8) security check includes the output from pkg-audit(8), for example:

```
Checking for packages with security vulnerabilities:
freetype2-2.5.3_2
mutt-1.5.23_6
```
Unless you run into some other bug it should be enough to only update when there's a vulnerability.


----------



## gkontos (Jan 22, 2015)

SirDice said:


> Unless you run into some other bug it should be enough to only update when there's a vulnerability.



Call it a strange habit maybe.... I like to keep my ports up2date on a weekly or at least monthly basis.


----------



## SirDice (Mar 24, 2015)

Certainly. But some people (think upper management and the like) don't like _any_ updates because it endangers the 'status quo'. Doing updates because there's a real need while keeping most at the same level or working state is just good system administration, in my opinion. Security vulnerabilities should at least be the minimalist requirement to update.


----------

