MacPorts,曾经叫做DarwinPorts,是一个软件包管理系统,用来简化Mac OS X和Darwin操作系统上软件的安装。它是一个用来简化自由软件/开放源代码软件的安装的自由/开放源代码项目,与Fink和BSD类ports套件的目标和功能类似。跟BSD中的ports道理一样。MacPorts就像apt-get、yum一样,可以快速安装些软件。

MacPorts下载与安装


一.通过(.pkg)安装: Mac OS X Package (.pkg) Installer

访问官方网站: http://www.macports.org/install.php
http://distfiles.macports.org/MacPorts/MacPorts-2.1.1-10.7-Lion.pkg

二.通过(Source)安装MacPorts:Source Installation

1.cd到Downloads/目录下wget下载 MacPorts-2.1.1.tar.gz
输入: wget https://distfiles.macports.org/MacPorts/MacPorts-2.1.1.tar.gz

2.解压 MacPorts-2.1.1.tar.gz 输入: tar zxvf MacPorts-2.1.1.tar.gz (tar jxvf MacPorts2.1.1.tar.bz2)

3.cd到解压到的目录MacPorts-2.1.1输入: ./configure && make && sudo make install 安装
中间提示输入密码完成安装!

7.然后将/opt/local/bin和/opt/local/sbin添加到$PATH搜索路径中
编辑/etc/profile文件 $ sudo vim /etc/profile (特许编辑,强制保存退出 wq!)文件最后加上下面两句

1
2
export PATH=/opt/local/bin:$PATH
export PATH=/opt/local/sbin:$PATH

MacPorts使用


1.Mac Port中第三方软件下载包存放的默认路径是:/opt/local/var/macports/distfiles/
为了提高安装速度,可以在安装新port时直接将此目录下的文件拷贝到新的Mac Port相同的目录中就可以避免Port去网上下载。

2.使用Mac Port前应该首先更新Port的index
输入: $ sudo port -v selfupdate (强烈推荐第一次运行的时候使用-v参数,显示详细的更新过程)

3.查看Mac Port中当前可用的软件包及其版本 输入: $ port list

4.查看有更新的软件以及版本 输入: $ port outdated

5.升级可以更新的软件 输入: $ sudo port upgrade outdated

6.在Mac Port搜索需要安装的软件包 输入: $ port search maven

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
HuiMinmatoMacBook-Pro:Downloads zikercn$ port search maven
maven @1.0.2 (java, devel)
    stub port, use maven1 instead
 
maven-ant-tasks @2.1.3 (devel, java)
    Use many of Maven's artifact handling features from Ant.
 
maven1 @1.1 (java, devel)
    A java-based build and project management environment.
 
maven2 @2.2.1 (java, devel)
    A java-based build and project management environment.
 
maven3 @3.0.4 (java, devel)
    A java-based build and project management environment.
 
maven_select @0.3 (sysutils)
    common files for selecting default Maven version
 
Found 6 ports.

7.搜索到需要安装的软件包之后,如何查看具体的软件包的内容和说明
输入: $ port info maven3

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
maven3 @3.0.4 (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 3 aims to ensure backward
                      compatibility with Maven 2, improve usability, increase
                      performance, allow safe embedding, and pave the way to
                      implement many highly demanded features.
Homepage:             http://maven.apache.org/
 
Build Dependencies:   kaffe
Runtime Dependencies: maven_select
Platforms:            darwin
License:              unknown
Maintainers:          blair@macports.org, gk5885@kickstyle.net

8.查看即将安装的或者已经安装的软件包的依赖关系
输入: $ port deps maven3

1
2
3
Full Name: maven3 @3.0.4_0
Build Dependencies:   kaffe
Runtime Dependencies: maven_select

9. 查看安装时允许客户定制的参数 输入: $ port variants maven3

1
maven3 has no variants

10.查看了软件包的内容和说明,并确认确实要安装,则输入: $ sudo port install maven3

1
2
3
4
5
6
7
To make maven 3.0.4 the default, please run
    sudo port select --set maven maven3
 
--->  Cleaning maven3
--->  Updating database of binaries: 100.0%
--->  Scanning binaries for linking errors: 100.0%
--->  No broken files found.

11. 卸载已经用Mac Port安装的软件 输入: $ sudo port uninstall maven3

1
2
3
4
--->  Deactivating maven3 @3.0.4_0
--->  Cleaning maven3
--->  Uninstalling maven3 @3.0.4_0
--->  Cleaning maven3

MacPorts卸载删除


1.卸载原有的MacPorts(如果你没有安装,直接跳过这一步,输入: $ port version 查看)
#原版使用MacPorts安装过的软件在/opt/local目录下,删除之前最好查看下,心里有个数.

1
2
3
4
5
6
7
8
9
10
11
12
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

Mac中MacPorts安装和使用 MacPorts简介的更多相关文章

  1. Mac中编译安装Qt 4.4

    解压下载到的.gz源码:gunzip xxx.tar.gztar xvf xxx.tar, 其实在Mac中可以直接双击解压的.然后定位到解压后的目录下:./configuremakesudo make ...

  2. ALC662 在Mac中的安装

    最近在装黑苹果,一切还算顺利(整了两周),就是ICH7的ALC662一直无法驱动成功.经过两天的爬文,终于成功了.以下是我的一点经验. 我装的是最新的10.9.2,显卡驱动是自带的(我的显卡为GT62 ...

  3. Mac中Eclipse安装和使用svn

    Eclipse版本为Neon Release (4.6.0) 安装svn 安装HomeBrew 在终端中输入 ruby -e "$(curl -fsSL https://raw.github ...

  4. Node: 在Mac中离线安装Sqlite3

    最近在安装db-migrate的时候,有一个依赖包sqlite3怎样都安装不了,检查下来应该是由于node_sqlit3.node文件无法从Amazon下载导致(源码安装也报错,没有研究过原因).于是 ...

  5. MAC中怎么安装python

    转自:https://blog.csdn.net/hou_manager/article/details/79555809 一.Python 介绍 Python介绍 Python3在2008年12月3 ...

  6. mac中eclipse安装openExplore插件

    插件地址:https://github.com/samsonw/OpenExplorer/downloads 将下载的jar包放入下面地址:应用程序->eclipse.app,右击->打开 ...

  7. redis在mac中的安装和启动

    http://blog.csdn.net/chenshuai1993/article/details/51519384 http://www.jianshu.com/p/6b5eca8d908b

  8. python语言特点简介 以及在Windows以及Mac中安装以及配置的注意事项

    正如前一篇随笔所提到的,python属于解释型语言 python语言有两个特点: 1.胶水语言(历史遗留问题,原来Perl语言作为Unix内置标准件,获得极大追捧,作为竞争者的python一开始是作为 ...

  9. Thrift入门之mac下的安装流程

    新建一个maven项目,先下载maven依赖  http://thrift.apache.org/download <dependency> <groupId>org.apac ...

随机推荐

  1. C语言实现双链表(带头节点)

    双链表和单链表性质相似只是在多加了一个前指针 1.定义结构体 typedef struct Node{ int data; struct Node *prior; struct Node *next; ...

  2. 在R语言环境中设置JRE路径

    解决办法: 1.如果没有java运行环境,则需安装对应版本的jre,如R64就需要安装jre64位的,并且要注意在系统环境变量中指定java_home 2.如果有java运行环境,检查你的java版本 ...

  3. GROUP_CONCAT 拼接顺序

    用 group_concat 拼接后的顺序 group_concat(id order by id) 里面id更新需要更换

  4. Win7环境下 IIS配置

    一.介绍IIS Internet Information Services(IIS,互联网信息服务),是由微软公司提供的基于运行Microsoft Windows的互联网基本服务.最初是Windows ...

  5. A TCP connection is distinguished by four values

    4个值唯一地定义一条TCP连接. HTTP The Definitive Guide A computer might have several TCP connections open at any ...

  6. QuantStart量化交易文集

    Over the last seven years more than 200 quantitative finance articles have been written by members o ...

  7. 剑指Offer——表示数值的字符串

    题目描述: 请实现一个函数用来判断字符串是否表示数值(包括整数和小数).例如,字符串"+100","5e2","-123","3. ...

  8. BS一机双屏的解决方式

    一.WebSocket通讯 WebSocket protocol 是HTML5一种新的协议.它实现了浏览器与server全双工通信. 为保证socket不间断.使用下面类库进行socket通讯. ht ...

  9. Spark Streaming Checkpoint反序列化问题分析

    转载自:https://mp.weixin.qq.com/s/EQgDUSf3TK0oVg1xmg-49Q Checkpoint是Spark Streaming中的核心机制,它为应用程序的7*24小时 ...

  10. 玩转DOM遍历——用NodeIterator实现getElementById,getElementsByTagName方法

    先声明一下DOM2中NodeIterator和TreeWalker这两类型真的只是用来玩玩的,因为性能不行遍历起来超级慢,在JS中基本用不到它们,除了<高程>上有两三页对它的讲解外,谷歌的 ...