That sounds to big and too vague for my little 640KB kernel.
Nope, instead it's simplicity itself... though this recipe is the last resort. In short, it's done by
pkg delete -a. This will delete all packages and clean the pkg db. If you don't know that already: whatever is installed via
portmaster(8) can be deleted via
pkg delete $portname.
Then, with the clean system and latest ports tree you go straight into
/usr/ports/ports-mgmt/pkg and issue
make install clean as root. Then do the same in
/usr/ports/ports-mgmt/portmaster. That's it! The rest is installed by
portmaster $portname, which will also install all the needed dependencies -- the latest versions, mind you.
I've got all but 3 of the ports updated. These continue to fail:
binutils tmux libevent2. I still haven't connected the missing link: if these are outdated or broken, why can't the tools I have tried just download the new correct port, instead of failing. My ports tree is up to date btw...
What exactly does portmaster say regarding each of these? Do you watch the message it outputs while building and installing? Which stage is it that fails? Fetching? Extracting? Building? Installing? It must be one of these, you know. Or is it "marked broken"? Or, are there any installed versions that cause conflict? What's in your
/etc/make.conf file? You've got to check each one of the above questions to get to the core of the problem.
Example: some app says it can't find
libjpeg.so.8. All right, issue
pkg info graphics/jpeg. If it says "not found", then do
portmaster graphics/jpeg. So press it, press it this way or another to get the output about the problem that causes it all.
And as was mentioned, drop this habit of installing apps "using either ports or packages". Should be either this or that.
And the ports tree being reported "up-to-date" by
portsnap(8) doesn't necessarily mean it's integrity being OK. Have faced that myself... Once, after continued failures to complete the Xorg build I had, as one of the measures, to delete
/usr/ports and fetch it anew. And that really worked.