According to MacPorts' wiki/guide you need to have a working Port command but in my case the Port command isn't working.
How do I uninstall MacPorts?
I have tried Googling the solution but what I found is that someone said on some random discussion board that just skip Port command part and directly move onto the next one but some files will remain.
I have seen a lot of 'solutions' online but most of them ending with the user reinstalling MacPorts due to corrupted/failed installation. This isn't what I am looking for.
I don't want some files to remain, I want to clean it completely as I am not planning to reinstall MacPorts any time soon.
*By the way, I have HomeBrew installed, I hope the solution that you guys offers won't tamper with my HomeBrew installation.
Thanks.
Best Answer
Found the solution myself. In order to get the
port
command to work, you must include it in your PATH variable or else the Terminal won't understand the command.Open Terminal then type this
open -e .bash_profile
then TextEdit will be opened with the .bash_profile loaded.Add this code into the next line
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Save your changes then typeport
in Terminal to see if it is working. Once you get theport
command working then just follow the uninstall guide.Source: MacPorts Guide