Fixing broken port dependencies based on missing files

So I cunningly removed ‘orphaned packages’ in an effort to reclaim much needed space on my system root, only to find that a certain daemon (CouchPotato) failed to run. There could have other consequences of this ‘mindless sweep’, but I had yet to encounter those.

To remedy this, I did:

1
# pkg check -d
  • to list missing dependencies (if any) by file-path.

Then,

1
# find /usr/ports -name pkg-plist -depth 3 -exec grep <name_of_missing_file> {} \+
  • revealing the primary port affected by missing dependencies. It was only then a matter of rebuilding both the primary port and its dependencies with:
1
# portmaster -fR <primary port>