FreeBSD – How to clean and rebuild all ports with Portmaster

Thanks to wblock, one of the admins of , the correct way to reinstall all existing ports with portmaster is given below:

1. portmaster --list-origins > ~/installed-port-list
2. Update the ports tree
3. portmaster -ty --clean-distfiles
4. portmaster -Faf
5. pkg delete -afy
6. rm -rf /usr/local/lib/compat/pkg
7. Back up any files in /usr/local you wish to save, such as configuration files in /usr/local/etc
8. Manually check /usr/local and /var/db/pkg to make sure that they are really empty
9. Install ports-mgmt/pkg and then ports-mgmt/portmaster. Remove both from ~/installed-port-list.
10. portmaster --no-confirm `cat ~/installed-port-list

Be the first to comment

Leave a Reply

Your email address will not be published.