HostOnNet Blog

portupgrade – upgrading installed ports

Today i have upgraded software packages installed on my FreeBSD 5.4 server. This is done with utility called portupgrade. To upgrade installed ports, you have to first install portupgrade from ports.

Check if you have portupgrade package already installed

# pkg_info | grep portupgrade
portupgrade-20041226_2 FreeBSD ports/packages administration and management tool s
#

If you don’t get any result, you don’t have portupgrade installed. You need to install it. To install portsupgrade, do the following.

# cd /usr/ports/sysutils/portupgrade
# make install clean
# rehash

Now you have portsupgrade installed on your FreeBSD server,

Next we will upgrade ports database

/usr/local/sbin/portsdb -Uu

Next we will find out which ports need updated, to do this, use the command

# /usr/local/sbin/portversion -l ”

Once we find out the ports that need upgraded, we can upgrade the ports with command

# /usr/local/sbin/portupgrade -arR

Now all ports will get upgraded.

# Run
# /usr/local/sbin/pkgdb -F
# if you are prompted to.

If some thing goes wrong, you can go back with

# Run
# /usr/local/sbin/pkgdb -fu
# if everything goes wrong.

Pray before doing this, so nothing goes wrong 🙂


Posted in FreeBSD. Bookmark the permalink.