Print View

Upgrading Ports/Packages
Updated: 10/21/2003


General Information

So, you install stuff from ports and then updates are released.  How do you upgrade your software without having to uninstall and reinstall?  This guide will show you how to use portupgrade.

Requirements

  1. Local root access on the box or be able to su to root.
  2. A SSH client such as puTTy or SecureCRT (if you are setting it up remotely).
  3. Portsnap or cvsup-without-gui
  4. Ports!  If you don't have ports installed, you can install it with /stand/sysinstall

Installation

In order for us to use the upgrade utility, we need to install it first.  So, logon to the machine as root or su to root.
#
#
cd /usr/ports/sysutils/portupgrade
make install clean

Configuration

Now we need to know what packages are out of date and update them.  You can either use the portsnap method or the legacy cvsup method.  I already use portsnap.
# portsnap fetch update
Now that the ports tree is updated, let's see which of our ports are outdated.
# pkg_version
apache                              =
cups-base                           <
cvsup-without-gui                   =
daemontools                         =
lynx                                =
m4                                  =
mod_php4                            <
nano                                =
p5-DBI                              <
p5-Data-ShowTable                   =
p5-Mysql-modules                    =
p5-Net-Daemon                       =
p5-PlRPC                            =
perl                                <
portupgrade                         =
samba                               =
ucspi-tcp                           =
wget                                =
You can also limit the display to only outdated packages with:
# pkg_version -L =
cups-base                           <
mod_php4                            <
p5-DBI                              <
perl                                <
As you can see, there are a few packages that need to be updated.  The format of portupgrade is as follows:
# portupgrade -o /path/to/port port_name
We're going to upgrade cups-base.  So, we will run
# portupgrade -o /usr/ports/print/cups-base cups-base
If you don't know where the port is located at, run:
#
#
cd /usr/ports
whereis port_name
Once it does its thing, you're all updated.  You can run that for each port, or if you are daring, you can upgrade every port with:
# portupgrade -ra


Author: Jon LaBass
jon at bsdguides dot org

Find this guide useful?
Support the author:


3 Comments

Posted by j79zlr1 on January 13, 2004 at 10:24:31 am EET

Couple things :)

If you install cvsup-without-gui the -g when running cvsup is redundant, that disables the gui.

After running cvsup you should build the ports index and database.

cd /usr/ports && make index && portsdb -u

This will take a while, as it is building over 10000 entries.


Posted by ela on January 13, 2004 at 10:24:31 am EET

Hi!

j79zlr1 wrote:

> After running cvsup you should build the ports index and database.

> cd /usr/ports && make index && portsdb -u

This is not necessary, as INDEX-5 is already updated by cvsup. In my case it even ruined my installation, and I had to sync the ports tree again. Even the "portsdb -u" didn't work anymore, because pkgtools weren't accessible.

The comment about the "-g" being obsolete in the cvsup call is what truely is obsolete. It doesn't do any harm either, and is good for people, who have the version with GUI installed.

Maybe some moderator can remove the obsolete/harmfull posting above, and mine with it?

I am a FreeBSD newbie, but I have many years of experience w/ other *NIXish systems. Thank you for this site.

Bye, Ela.


Posted by j79zlr1 on January 13, 2004 at 10:24:31 am EET

Running "make index" shouldn't hurt anything, and will make sure the index is correct.  I've done this hundreds of times with no problems.

Sorry ela, but portupgrade, [portsdb being part of it] was busted by the latest changes with ruby.  

Personally, you are a self-described newbie, and I think you were a bit harsh with me.  Especially since all you had to do was to reinstall portupgrade and it would have fixed your problem.  Next time search through the newsgroups, instead of saying I broke your PC.


Copyright 2003 - 2008 BSD Guides.  All rights reserved.

About | Terms of Use | Privacy | Contact