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.

  • That is true, you have to pray before doing such things, I do not, telling is easy 🙂

    After i run, /usr/local/sbin/portupgrade -arR

    I installed digital tablet on my PC, it asked me to reboot, i press no, now the pen take control and i could not move my mouse properly, after several try, i press OK, that is system reboot. And the portupgrade stoped half way.

    After rebooting, i loged into server and run it again, i got follwing message

    server14# /usr/local/sbin/portupgrade -arR
    Stale dependency: portupgrade-20041226_2 –> ruby-1.8.2_3 — manually run ‘pkgdb -F’ to fix, or specify -O to force.
    server14# pkgdb -F
    —> Checking the package registry database
    [Updating the pkgdb in /var/db/pkg … – 66 packages found (-0 +0) done]
    Stale dependency: portupgrade-20041226_2 -> ruby-1.8.2_3 (lang/ruby18):
    ruby18-bdb1-0.2.2 (score:22%) ? ([y]es/[n]o/[a]ll) [no] a
    Fixed. (-> ruby18-bdb1-0.2.2)
    Stale dependency: ruby18-bdb1-0.2.2 -> ruby-1.8.2_3 (lang/ruby18):
    Fixed. (-> ruby18-bdb1-0.2.2)
    Cyclic dependencies: ruby18-bdb1-0.2.2 -> (ruby18-bdb1-0.2.2)
    Unlink ruby18-bdb1-0.2.2 -> ruby18-bdb1-0.2.2 ? [yes] a
    Done.
    server14#

    After doing this, everything going fine 🙂