Red Antigua Logo slogan
Ads by Goooooogle
Search this site (by Google)
Menu
Home
About
Tools
Perl modules
Perl tutorials
C tutorials
Server configurations
UNIX on Windows
Misc. FreeBSD/UNIX
Redirect a web page
JavaScript
Virus list
Old stuff
Off topic

Tools    (top)
Your IP
Check a site for broken links
(W3C)

Perl modules    (top)
Tree::Numbered::Tools
(CPAN)
Perl tutorials    (top)
Perl modules
HTML::Template
CGI::Application
Mail::POP3Client
Mail::Send
MIME::Tools
Cookies with CGI::Application
Upload files with CGI::Application
Download files with CGI::Application
Redirect with CGI::Application
CPAN shell
Install DBD::mysql from the CPAN shell
Perl trim function
Validate an IP with Perl
Run suid Perl scripts under Apache
Perl taint mode
Perl date functions with Date::Calc

In Spanish
Curso de Perl

C tutorials    (top)
C - Introduction
C - Absolute beginner's Emacs
C - Examples for beginners
C - Makefile examples
C - Autotools examples
Server configurations    (top)
DNS
Apache
Apache Authentication and Access Control
mod_perl on FreeBSD
MySQL
MySQL add account
phpMyAdmin
Squid
DHCP

UNIX on Windows    (top)
Apache setup on Windows
MySQL setup on Windows
PHP setup on Windows
Perl setup on Windows
Emacs setup on Windows
UnxUtils
PuTTY
WinSCP
GIMP on Windows
MinGW - gcc on Windows
MSYS - make-in-a-shell on Windows
msysDTK - autotools on Windows
GDB for MinGW on Windows

Misc. FreeBSD/UNIX    (top)
CD and DVD creation on FreeBSD using 'k3b' on FreeBSD
'ipf' on FreeBSD
'pf' on FreeBSD
'su' on FreeBSD
Mount an ISO image under FreeBSD
Load the correct sound driver under FreeBSD without knowing what sound card you are using
Simultaneous sound channels on FreeBSD
Boot floppies for FreeBSD
Problems with old disks/controllers and the 'ata' driver
FreeBSD network stuff
DOS-to-UNIX file conversion
favicon.ico on UNIX
Emacs tips
Sendmail tips
GKrellm
Command Line Calculator
Save multimedia streams with 'mplayer'
xargs - solution to 'Argument list too long'
Process multiple images from the command line using 'ImageMagick'
Turn the system bell off under X Windows
Process each line in an input file from the command line (or in a shell script)
How to keep a program running in the background using 'nohup'
How to remove symbolic links in the current directory using 'find' and 'rm'
How to remove Emacs backup files in the current directory and all subdirectories using 'find' and 'rm'
How to execute .profile without logging in

Redirect a web page    (top)
Redirect to another web page
Apache redirect
C redirect
Perl redirect
PHP redirect
HTML redirect
JavaScript redirect

Javascript    (top)
Trim function
Login form
Register form
Popup window

Virus list    (top)
Latest viruses - Computer Virus HQ (external)
Latest 10 viruses - Sophos

Links    (top)
HTML and PHP Scripts - Html Web Template

Old stuff    (top)
POP3 server setup
About AnyMail
AnyMail downloads

Off topic    (top)
Personal links

Validated by
Valid HTML 4.01!
Valid CSS!
Powered by
apache.org
FreeBSD portupgrade
FreeBSD portupgrade        
This is a quick tutorial how to update your FreeBSD ports collection using portupgrade.

First time portupgrade - includes installing the needed tools
Just upgrade ports - assumes tools already installed
Troubleshooting:
- General error - general solution
- 'PkgDB::DBError' (2005-12-17)
- 'make: don't know how to make describe.' (no date)
- 'Port info line must consist of 10 fields.' (no date - old, before July 2004)
See also

First time portupgrade - includes installing the needed tools: (top)
# Install "text mode" cvsup
cd /usr/ports/net/cvsup-without-gui
make install clean

# Optional: Install the utility "fastest_cvsup" to decide which CVSup server is best for you
cd /usr/ports/sysutils/fastest_cvsup
make install clean

# Synchronize your ports collection (using the fastest_cvsup tool to get the fastest CVSup server - example checks in US only)
FASTEST_CVSUP=`fastest_cvsup -Q -c us`; echo $FASTEST_CVSUP
/usr/local/bin/cvsup -g -L 2 -h $FASTEST_CVSUP /usr/share/examples/cvsup/ports-supfile

or

# Synchronize your ports collection (just choosing any CVSup server)
/usr/local/bin/cvsup -g -L 2 -h cvsup17.freebsd.org /usr/share/examples/cvsup/ports-supfile

# Install portupgrade 		    
cd /usr/ports/sysutils/portupgrade (old directory)
cd /usr/ports/ports-mgmt/portupgrade (new directory)
make install clean

# Update the ports database
/usr/local/sbin/portsdb -Uu

# List the installed ports which need upgrading
/usr/local/sbin/portversion -l "<"

# Upgrade the installed ports
/usr/local/sbin/portupgrade -arR

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

# Run
# /usr/local/sbin/pkgdb -fu
# if everything goes wrong.
Just upgrading ports - assumes that cvsup-without-gui, portupgrade, and (optionally) fastest_cvsup already are installed: (top)

# Synchronize your ports collection (using the fastest_cvsup tool to get the fastest CVSup server)
FASTEST_CVSUP=`fastest_cvsup -Q -c us`; echo $FASTEST_CVSUP
/usr/local/bin/cvsup -g -L 2 -h $FASTEST_CVSUP /usr/share/examples/cvsup/ports-supfile

or

# Synchronize your ports collection (just choosing any CVSup server)
/usr/local/bin/cvsup -g -L 2 -h cvsup17.freebsd.org /usr/share/examples/cvsup/ports-supfile

# Update the ports database
/usr/local/sbin/portsdb -Uu

# List the installed ports which need upgrading
/usr/local/sbin/portversion -l "<"

# Upgrade the installed ports
/usr/local/sbin/portupgrade -arR

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

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

Some times it may be necessary to uninstall and then reinstall one or more ports manually.


Troubleshooting experiences: (top)

1. General error - general solution (top)
In case of an error, always try this first:
/usr/local/sbin/pkgdb -fu
From man portupgrade: "Even if you don't do anything wrong, a package database may get corrupt somehow when it is heavily updated. In such cases, run ``pkgdb -fu'."
2. 'PkgDB::DBError' (2005-12-17) - Solution: /usr/local/sbin/pkgdb -fu (top)
I ran
/usr/local/bin/cvsup -g -L 2 -h cvsup17.freebsd.org /usr/share/examples/cvsup/ports-supfile
and
/usr/local/sbin/portsdb -Uu
without any problem. But
/usr/local/sbin/portversion -l "<"
failed:
root@jf# /usr/local/sbin/portversion -l "<"
[Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 515 packages found
(-1 +8) (...)........ done]
(? bsdpan-CGI-Application-Plugin-DBH-3.00)(? bsdpan-DBD-Mock-0.26)(? bsdpan-Pars
e-RecDescent-1.94)/usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:351:in `deorigin_gl
ob': Invalid argument (PkgDB::DBError)
        from /usr/local/lib/ruby/site_ruby/1.8/pkgtools.rb:177:in `config_includ
e?'
        from /usr/local/lib/ruby/site_ruby/1.8/pkgtools.rb:172:in `each'
        from /usr/local/lib/ruby/site_ruby/1.8/pkgtools.rb:172:in `config_includ
e?'
        from /usr/local/lib/ruby/site_ruby/1.8/pkgtools.rb:162:in `config_held?'
        from /usr/local/sbin/portversion:310:in `check_pkgs'
        from /usr/local/sbin/portversion:300:in `each'
        from /usr/local/sbin/portversion:300:in `check_pkgs'
        from /usr/local/sbin/portversion:260:in `main'
        from /usr/local/sbin/portversion:77:in `initialize'
        from /usr/local/sbin/portversion:77:in `new'
        from /usr/local/sbin/portversion:77:in `main'
        from /usr/local/sbin/portversion:347
root@jf#
Forgot about my own suggestion on this very page :-(
# Run
/usr/local/sbin/pkgdb -fu
# if everything goes wrong.
After that I could run both
/usr/local/sbin/portversion -l "<"
and
/usr/local/sbin/portupgrade -arR
without any problem.
3. 'make: don't know how to make describe.' - Solution: refetch and restore the ports collection (top)
Once I was dumb enough to install a port while I was running a portupgrade.
I don't know what part of the ports collection became corrupt, but I tried many ways to fix it.
Error before the fix:
bash-2.05b# /usr/local/sbin/portsdb -Uu
Updating the ports index ... Generating INDEX.tmp - please wait..make: don't know how to make describe. Stop
===> textproc/p5-Sort-PolySort failed
*** Error code 1
1 error
The final solution was to refetch the entire ports collection (almost as quick as a portupgrade, just add the time for downloading the ports collection).
cd /usr
mv ports ports.CORRUPT
fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.gz
gunzip -c ports.tar.gz| tar -xf -
mv /usr/ports.CORRUPT/distfiles /usr/ports/
/usr/local/bin/cvsup -g -L 2 -h cvsup17.freebsd.org /usr/share/examples/cvsup/ports-supfile
/usr/local/sbin/portsdb -Uu
/usr/local/sbin/portversion -l "<"
/usr/local/sbin/portupgrade -arR

4. 'Port info line must consist of 10 fields' - Solution: deinstall/reinstall portupgrade (top)
This problem will probably occur only on old versions on FreeBSD, with an old version of portupgrade installed.
Check your portupgrade version:
pkg_info -I portupgrade\*
If your portupgrade version is more recent or equal to 20040701_3, you can stop read here - your problem isn't version-related.
Long description:
Once I had an unexpected power-off during the portsdb -Uu command.
After rebooting and trying to continue portsdb -Uu, the command failed with the following error:
...
/usr/ports/INDEX-5:3:Port info line must consist of 10 fields.
/usr/ports/INDEX-5:4:Port info line must consist of 10 fields.
/usr/ports/INDEX-5:5:Port info line must consist of 10 fields.
...
I just waited until the next day, ran cvsup again, and some ports were updated, so then I had a new INDEX.
(I also browsed mailing lists confirming that this was the way to go in case of a ports collection out of sync.)
Then I had a new error message:
bash-2.05b# /usr/local/sbin/portsdb -Uu
Updating the ports index ... Generating INDEX.tmp - please wait..make: don't know how to make describe. Stop
===> ftp/lukemftpd failed
*** Error code 1
1 error

********************************************************************
Before reporting this error, verify that you are running a supported
version of FreeBSD (see http://www.FreeBSD.org/ports/) and that you
have a complete and up-to-date ports collection.  (INDEX builds are
not supported with partial or out-of-date ports collections -- in
particular, if you are using cvsup, you must cvsup the "ports-all"
collection, and have no "refuse" files.)  If that is the case, then
report the failure to ports@FreeBSD.org together with relevant
details of your ports configuration (including FreeBSD version,
your architecture, your environment, and your /etc/make.conf
settings, especially compiler flags and WITH/WITHOUT settings).

Note: the latest pre-generated version of INDEX may be fetched
automatically with "make fetchindex".
********************************************************************

*** Error code 1

Stop in /usr/ports.
*** Error code 1

Stop in /usr/ports.
failed to generate INDEX!
portsdb: index generation error
I tested
cd /usr/ports
make fetchindex
which downloaded a pre-generated INDEX-5 file, but portsdb -Uu still failed with the same error.
I tried cvsup again, and then portsdb -Uu.
This did not work either.

I tried various cvsups and portupgrades without success.
Finally, I found a thread at http://www.mail-archive.com/freebsd-questions@freebsd.org/msg72733.html, which indicated a format change for portupgrade.
The solution was to deinstall the current portupgrade version, and reinstall it.
As the cvsup already had upgraded the port's info, I just did:
cd /usr/ports/sysutils/portupgrade
make deinstall
make install clean
Then /usr/local/sbin/portsdb -Uu worked just fine.

See also: (top) Read more about portupgrade from Dru Lavigne's excellent portupgrade tutorial.
The only thing where I do things in a different order from her tutorial, is synchronizing the ports collection before installing the portupgrade port the first time I upgrade the ports collection on a new system.
This has saved me a lot of trouble, as an upgraded version of portupgrade does not suffer from broken dependencies.

Read more at http://wikitest.freebsd.org/portupgrade.
Last modified: Sat Apr 21 11:27:25 CEST 2007