v6g2fi4nn7 发表于 2016-5-15 10:53:02

mac os x 安装macports

Mac下面除了用dmg、pkg来安装软件外,比较方便的还有用MacPorts来帮助你安装其他应用程序,跟BSD中的ports道理一样。MacPorts就像apt-get、yum一样,可以快速安装些软件。  下面将MacPorts的安装和使用方法记录在这里以备查。
  访问官方网站http://www.macports.org/install.php,这里提供有dmg安装和源码安装两种方式,dmg就不多说了,下一步下一步安装即可。
  

  安装之前确保:
  
  Note: Make sure that /opt/local/bin appears in your path BEFORE/usr/bin. If not, add

export PATH=/opt/local/bin:$PATH

  to your ~/.bash_profile.


  通过Source安装MacPorts

wget http://distfiles.macports.org/MacPorts/MacPorts-2.0.4.tar.gz
tar zxvf MacPorts-2.0.4.tar.gz
cd MacPorts-2.0.4
./configure && make && sudo make install
cd ../
rm -rf MacPorts-2.0.4*


  
  MacPorts使用

更新ports tree和MacPorts版本,强烈推荐第一次运行的时候使用-v参数,显示详细的更新过程。
  

sudo port -v selfupdate
  
  搜索索引中的软件


port search name安装新软件sudo port install name  
  卸载软件


sudo port uninstall name  
  查看有更新的软件以及版本


port outdated
  
  升级可以更新的软件


sudo port upgrade outdated

  
页: [1]
查看完整版本: mac os x 安装macports