Mac Port基本用法總結 1. Mac Port的 http://www.macports.org/install.php www.2cto.com 2. Mac Port的說明文檔 http://guide.macports.org/ 3. Mac Port中第三方軟體下載包存放的預設路徑是:/opt/local/var/macports/distfiles/ 為了提高安裝速度,可以在安裝新port時直接將此目錄下的檔案拷貝到新的Mac Port相同的目錄中就可以避免Port去網上下載。 www.2cto.com 4. 使用Mac Port前應該首先更新Port的index 引用$ sudo port selfupdate Password: Warning: port definitions are more than two weeks old, consider using selfupdate ---> Updating the ports tree ---> Updating MacPorts base sources using rsync MacPorts base version 1.9.2 installed, MacPorts base version 1.9.2 downloaded. ---> MacPorts base is already the latest version The ports tree has been updated. To upgrade your installed ports, you should run port upgrade outdated 5. 查看Mac Port中當前可用的軟體包及其版本 引用$ port list rabbitmq-server @2.4.0 net/rabbitmq-server AppHack @1.1 aqua/AppHack AppKiDo @0.985 aqua/AppKiDo AquaLess @1.6 aqua/AquaLess ArpSpyX @1.1 aqua/ArpSpyX AssignmentTrackerX @2.0beta3.1 aqua/AssignmentTrackerX BigSQL @1.0 aqua/BigSQL BiggerSQL @1.3.9 aqua/BiggerSQL Books @3.2.5c aqua/Books ...... 4. 在Mac Port如何搜尋需要安裝的軟體包? 引用$ port search maven maven @1.0.2 (java, devel) A java-based build and project management environment. maven-ant-tasks @2.0.10 (devel, java) Use many of Maven's artifact handling features from Ant. maven2 @2.2.1 (java, devel) A java-based build and project management environment. maven3 @3.0.3 (java, devel) A java-based build and project management environment. maven_select @0.3 (sysutils) Switch the default Maven java build tool Found 5 ports. 5. 搜尋到需要安裝的軟體包之後,如何查看具體的軟體包的內容和說明? 引用$ port info maven2 maven2 @2.2.1, Revision 3 (java, devel) Description: Maven is a Java project management and project comprehension tool. Maven is based on the concept of a project object model (POM) in that all the artifacts produced by Maven are a result of consulting a well defined model for your project.Builds, documentation, source metrics, and source cross-references are all controlled by your POM. Maven 2.0 is a complete rewrite of Maven 1.0 and as such is better organized, faster and easier to use. Homepage: http://maven.apache.org/ Build Dependencies: kaffe Library Dependencies: maven_select Platforms: darwin License: unknown Maintainers: blair@macports.org, gk5885@kickstyle.net 6. 查看即將安裝的或者已經安裝的軟體包的依賴關係 引用$ port deps maven2 Full Name: maven2 @2.2.1_3 Build Dependencies: kaffe Library Dependencies: maven_select 7. 查看安裝時允許客戶定製的參數 引用$ port variants maven2 maven2 has no variants 8. 查看了軟體包的內容和說明,並確認確實要安裝,則 引用$ sudo port install maven2 9. 安裝完畢之後,清除安裝時產生的臨時檔案 引用$ sudo port clean --all maven2 ---> Cleaning maven2 10. 卸載已經用Mac Port安裝的軟體 引用sudo port uninstall maven2