When upgrading from one major version of FreeBSD to another, in my case from FreeBSD/amd64 stable/9 to FreeBSD/amd64 stable/10, it’s customary to upgrade the installed ports afterwards, beginning with
I forcefully upgraded all installed ports using
portupgrade -afpv, but the upgrade of
lang/ruby21 failed miserably.
I removed all traces of Ruby 2.1, i.e.
databases/ruby-bdb, before manually compiling and installing
ports-mgmt/portupgrade using the ports collection.
Now, I needed to know which remaining ports were still compiled for stable/9. The following snippet allowed me to gather the origins of such ports:
pkg query -a %o:%q | grep freebsd:9: | cut -d : -f 1
Now, I could feed that list to the newly installed
portupgrade and upgrade the remaining ports:
portupgrade -fprv `pkg query -a %o:%q | grep freebsd:9: | cut -d : -f 1`
In the end, I should have removed
lang/ruby21 completely after upgrading
ports-mgmt/pkg, and reinstalled
ports-mgmt/portupgrade manually using the ports collection. Only then is it safe to forcefully rebuild and reinstall all the other ports. Don’t forget to add
devel/cvs if you used to rely on
cvs in base, and adjust all references from