# New install and run Portsnap fetch extract update?



## neilms (Aug 4, 2012)

I have just installed FreeBSD production release version 9.0. The first thing I did was to run:
'Portsnap fetch extract update'.

I have had problems in the past keeping my system up to date and want to make sure everything works smoothly this time. Is there anything else that I need to do at this stage to keep updated?


----------



## kpa (Aug 4, 2012)

The first time you run portsnap(8) (when /usr/ports is empty) the command is
`# portsnap fetch extract`

After this you never use extract anymore unless you want to completely overwrite /usr/ports again. The command to update the ports tree from this on is

`# portsnap fetch update`

That's only the ports tree part of keeping up to date. You have to then  decide if you want to use pre-built packages for updates or compile everything yourself using ports. See this post by vermaden for more information:

http://forums.freebsd.org/showpost.php?p=146168&postcount=3


----------



## Ogham (Aug 4, 2012)

You might want to update your base system also 


```
man freebsd-update
```


----------



## neilms (Aug 4, 2012)

kpa said:
			
		

> The first time you run portsnap(8) (when /usr/ports is empty) the command is
> `# portsnap fetch extract`
> 
> After this you never use extract anymore unless you want to completely overwrite /usr/ports again. The command to update the ports tree from this on is
> ...



I have two further questions:

1. Ok, I read the post by vermaden and installed the update tools referred to in it. The system reported that I should run /usr/local/sbin/portaudit -Fda , which I did. I then got the report 'portaudit-0.5.17' has a problem with remote code execution and it is recommended that I update or deinstall it immediately. This is strange as I just installed it. In any case, how to I update this particular binary?

2. The shell script functions that vermaden provides ie. function ports-check, ports-update and ports-build all go in the shell startup profile. Does this mean that they will be run each and every time I start my computer? If so, this might not be a suitable method for me as I tend to start and turn off my laptop several times a day. Is this advice geared more towards a server system that does not reboot frequently?


----------



## kpa (Aug 4, 2012)

1. Your ports-mgmt/portaudit is too old, update it first by doing
`# cd /usr/ports/ports-mgmt/portaudit`
`# make install clean`

It's a good idea to set PACKAGESITE environment variable in your shell init file to this value if you plan on using pre-built packages:


```
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-stable/Latest/
```

Replace i386 with amd64 if your system uses the amd64 version of FreeBSD9.

2. The shell functions are defined for use, not run automatically.

You don't have to follow vermaden's guide to the letter, it should give you a rough outline what should be run and in which order to update installed ports/packages.


----------

