An annoyance that seems to haunt all package management systems: FreeBSD has been much less painful to use than RPM, but it still has issues.
This seems to crop up for some users:
[/opt/ports] # portupgrade -a
/usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:322:in `deorigin': cannot convert nil into String (PkgDB::DBError)
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:915:in `tsort_build'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:914:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:914:in `tsort_build'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:906:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:906:in `tsort_build'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:928:in `sort_build'
from /usr/local/lib/ruby/site_ruby/1.8/pkgdb.rb:932:in `sort_build!'
from /usr/local/sbin/portupgrade:674:in `main'
from /usr/local/sbin/portupgrade:207:in `initialize'
from /usr/local/sbin/portupgrade:207:in `new'
from /usr/local/sbin/portupgrade:207:in `main'
from /usr/local/sbin/portupgrade:1869
and the stock answer seems to be to remove the pkgdb.db file and rebuild it with a less buggy hashing method (bdb1-tree, dbm_hash — anything but the default Berkeley DB).
But what if you try all the options and get the same result?
For some reason, the portmanager port can handle whatever is amiss in the database/package registry just fine. I simply get a list of ports that are outdated:
portmanager -s | grep OLD > /tmp/pkg
Then step through them and upgrade them, one by one.
rm /tmp/pkg && \
portmanager -s | grep OLD > /tmp/pkg && \
for i in `grep "/" /tmp/pkg | awk -F\/ '{ print $3 }' `; do portupgrade $i; done
What’s interesting is that portupgrade works on one port at a time, but loses its mind if asked to do all outdated ports.
[composed and posted with ecto]