I'm rebuilding world and would like to have every other file not created by the rebuilding of world to be deleted. Is there some mergemaster option for this?


You can use the make targets delete-old and delete-old-libs to remove obsolete files. They run interactively, unless you set BATCH_DELETE_OLD_FILES:

# pwd
# make -DBATCH_DELETE_OLD_FILES delete-old

Run them after make installworld.

Have a look at build(7) for more details.

A word of warning - be careful with delete-old-libs - it will delete anything that was not built as part of the current world/kernel so if any of your installed ports rely on older versions of any system libs, you'll need to reinstall the affected ports. I usually run delete-old-libs after a complete port rebuild to avoid this problem.

  • Thank you so much! Just to be sure, though, would it delete literally everything that isn't from the build? – Nanotwerp Apr 12 '15 at 16:59
  • They will only delete obsolete files that were installed as part of the base system - executables, headers, documentation, etc. delete-old-libs will only delete obsolete shared libraries. You can use the target check-old to see what the other two would delete. – D_Bye Apr 14 '15 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.