Macports and homebrew are both software package management tools (via Wikipedia) on Mac OS X and are incompatible with each other. here we will not introduce the benefits. We will talk about deleting macports and installing homebrew.
Prerequisites:
- Mac comes with a ruby program. If you "process" it, make sure it exists. Use ruby-V to view the version number.
- Install xcode
- Open terminal (Terminal)
Delete macports:
# The software installed using macports in the original version is in the/opt/local directory. You 'd better check the number of software installed before deleting it.
Sudo port-F uninstall installed
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
No sudo:
Sudo chown-r 'whoam'/usr/local
# Do not execute the sudo operation every time
Install homebrew:
Curl-l http://github.com/mxcl/homebrew/tarball/master | tar xz-strip 1-C/usr/local
Export Path =/usr/local/bin: $ path
# After the installation is complete, it is installed in the/usr/local directory. You can view the version number through brew-v.
Install software through homebrew:
Find the software you need and run the brew search * command to install and use the brew install * command (Replace with the specific software name *). The following is an example:
Brew search git
Brew install git
If you want to install vim, wget, unrar, and other software, do the same.
In addition, if you have installed git, you have created a local git repository and executed the following:
- CD/usr/local
- Git init
- Git remote add origin git: // github.com/mxcl/homebrew.git
- Git pull origin master
If there is a project on GitHub, you can also take it directly:
- Git clone http://github.com/YOURGITHUBUSERNAME/homebrew.git/tmp/homebrew
Other homebrew commands:
Brew list-List Installed Software
Brew Update-update homebrew
Brew home *-open in a browser
Brew info *-display software content
Brew deps *-display package Dependencies
Brew server *-start the Web server. You can access http: // localhost: 4567/in a browser to manage packages on the same webpage.
Brew-H brew-help
Delete homebrew:
In case you are uncomfortable, tell you to uninstall the command:
- CD 'brew-prefix'
- Rm-RF cellar
- Brew prune
- Rm-RF library. Git. gitignore bin/brew readme. md share/man/Man1/brew
- Rm-RF ~ /Library/caches/homebrew
Complete.