Introduction
The Migration Assistant is a handy tool on macOS that allows you to transfer data, settings, and applications from an old Mac to a new one seamlessly. However, if you’ve used MacPorts to manage packages and ports on your old Mac, you might encounter some issues during or after the migration process. MacPorts installations are user-specific, which means they can’t be directly transferred using the Migration Assistant. If you’re looking to clean up your new Mac and remove the remnants of your old MacPorts user, this guide will walk you through the steps to do just that.
Before You Begin, You’ll need an admin account on your macOS to perform these tasks.
$ dscl . list /Users | grep -v '^_'
daemon
Guest
macports <--------------------------------------------- remove?
mixelpix
nobody
root
$ /usr/bin/dscl . -search /Users name macports
macports dsAttrTypeNative:name = (
macports <----------------------------------------- confirm...
)
$ sudo /usr/bin/dscl . -delete "/Users/macports" <---- DELETE
Password:
$ dscl . list /Users | grep -v '^_' <----------------- GONE!
daemon
Guest
mixelpix
nobody
root
Conclusion
Deleting a MacPorts user and cleaning up the associated files after using the Migration Assistant can help you maintain a clean and efficient macOS system. Whether you choose to stick with MacPorts, migrate to Homebrew, or use another package manager, following these steps will ensure that you have a fresh start on your new Mac without any lingering traces of the old user account.