因为Mac的底层是bsd的,所以我们一可以使用bsd的软件包安装方式–Macports,类似linux下的yum apt-get.
访问官方网站http://www.macports.org/install.php,这里提供有dmg安装和源码安装两种方式,dmg就不多说了,下一步下一步安装即可。
下载地址http://distfiles.macports.org/MacPorts/
1、
vim
~/.bash_profile
export PATH=/opt/local/bin:$PATH
source ~/.bash_profile
2、通过Source安装MacPort
wget http://distfiles.macports.org/MacPorts/MacPorts-2<strong id="speechFragmentSeparator__1_13" class="speechFragmentSeparator" style="margin: 0px; padding: 0px; border: 0px; font-size: 12px; font: inherit; vertical-align: baseline; font-weight: inherit; font-style: inherit;">.1</strong>.2.tar.gz tar zxvf MacPorts-2.1.2.tar.gz cd MacPorts-2.1.2 ./configure && make && sudo make install cd ../ rm -rf MacPorts-2<strong id="speechFragmentSeparator__1_16" class="speechFragmentSeparator" style="margin: 0px; padding: 0px; border: 0px; font-size: 12px; font: inherit; vertical-align: baseline; font-weight: inherit; font-style: inherit;">.1</strong>.2*
MacPorts使用
参见官方文档:http://guide.macports.org/#installing.shell
sudo port -v selfupdate
搜索索引中的软件
port search name
安装新软件
sudo port install name
sudo port uninstall name
查看有更新的软件以及版本
port outdated
升级可以更新的软件
sudo port upgrade outdated