Corrupt Package Database?

Ron & Ariane Joordens joordens at
Wed Apr 28 00:18:15 PDT 2004

Hello FreeBSDers, 
I have a problem that is way beyond my extremely limited knowledge of
I know, that's not hard to do :-) 
I was using portupgrade to upgrade KDE to 3.2.1 one part at a time. ie. 
KDEbase, then KDEnetwork, etc. After each successful upgrade, I do
to check what the next KDE port is. Each time it would prompt me to do a
-F which in turn would indicate a stale dependancy openSSL and suggest a
dependancy openLDAP to which of course I would say no. The last time
instead of saying no to creating a new dependancy and then deleting the 
openSSL dependancy, I replied 'a' for all (default was no) and it did not
me to create a new dependancy. 
Since then I have been unable to upgrade any port. 
For instance portupgrade -Rr zsh produces the following error message 
===>  Checking if shells/zsh already installed 
pkg_info: /var/db/pkg/gedit2-2.4.1_1/+CONTENTS: No such file or directory 
*** Error code 1 
Stop in /usr/ports/shells/zsh. 
*** Error code 1 
Stop in /usr/ports/shells/zsh. 
** Command failed [exit code 1]: /usr/bin/script -qa
make reinstall 
egrep: /var/db/pkg/gedit2-2.4.1_1/+CONTENTS: No such file or directory 
egrep: /var/db/pkg/zsh-4.0.9/+CONTENTS: No such file or directory 
--->  Restoring the old version 
pkg_add: /var/db/pkg/gedit2-2.4.1_1/+CONTENTS: No such file or directory 
Updating /etc/shells 
** Fix the installation problem and try again. 
[Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 241 packages 
found (-0 +1) . done] 
** The following packages were not installed or upgraded 
(*:skipped / !:failed) 
        ! shells/zsh (zsh-4.0.9)        (install error) 
I checked the /var/db/pkg directory and just as reported gedit2 and koffice
not have +CONTENTS files. (They are the only ones without this file) 
I have searched the web for a solution to this but the only thing I found
wasn't highly technical was a post in German that seemed to indicate a
This I did successfully, but when I run portsdb -Uu I get the following
freebsd# portsdb -Uu 
Updating the ports index ... Generating INDEX.tmp - please wait..===> 
chinese/openoffice-zh_CN failed: 
"Makefile", line 17: Could not 
find /usr/ports/chinese/openoffice-zh_CN/../../editors/openoffice/Makefile 
make: fatal errors encountered -- cannot continue 
*** Error code 1 
1 error 
Before reporting this error, verify that you are running a supported 
version of FreeBSD (see and that you 
have a complete and up-to-date ports collection.  If so, then report 
the failure to ports at together with relevant details of 
your ports configuration (including FreeBSD version, environment and 
*** Error code 1 
Stop in /usr/ports. 
*** Error code 1 
Stop in /usr/ports. 
failed to generate INDEX! 
portsdb: index generation error 
Does anyone know how to rebuild the +CONTENTS files? 
Are the two error message related? 

More information about the freebsd-questions mailing list