Migrate from MacPorts to Homebrew
I decided to migrate from MacPorts to Homebrew.
Photo by Michael Surazhsky on Unsplash |
The reasons are:
- It is very intimidating when all of my coworkers use brew.
- Most of the Google SDK documentation prefer homebrew to Macports.
- I hope I can get another point of view when using a different package manager in OSX.
Uninstall All Ports
sudo port -fp uninstall installed
This way, you uninstall all the ports you have installed before. If you are not sure, make some backup for your configuration files (which I didn't do).
Remove Users and Groups
Clean up the rest
Macport puts every installation on /opt/local folder. So we need to purge everything inside that folder.
$ sudo rm -rf
\ /opt/local
\ /Applications/DarwinPorts
\ /Applications/MacPorts
\ /Library/LaunchDaemons/org.macports.*
\ /Library/Receipts/DarwinPorts*.pkg
\ /Library/Receipts/MacPorts*.pkg
\ /Library/StartupItems/DarwinPortsStartup
\ /Library/Tcl/darwinports1.0
\ /Library/Tcl/macports1.0
\ ~/.macports
It is absolutely fine if you don't have all the above paths, because that depends on which version of Macports you run.
I was stuck when deleting /opt/local/var/db/postgresql folder. The error message was "Operation not permitted". That is because we need to give full disk access to Terminal to do the task. Go to the "Security & Privacy" section, Privacy, Full Disk Access, and then check Terminal.
Install Brew
What that line does is just download the install.sh file and run it. You might consider that Brew uses /usr/local folder (instead of a custom /opt/local folder like Macports does), so be aware if you have existing executable files that may cause some conflicts.
My Experience of Brew (so far)
Brew works like a charm. I don't have difficulties installing some packages for web development.
brew doctor
This command will give you some warnings related to the OSX version, Command Line Tools release, or Xcode that outdated. You can ignore those warning messages and keep moving on.
- Everything is owned by the user. No need to worry about risky root access while installing packages.
- Every installed package is cleanly sandboxed.
- Very up to date.
Comments
Post a Comment
Speak now or forever hold your peace