tutorial on installing and using the MacPorts package management system in Mac

Source: Internet
Author: User
Tags object model

The

macports introduction

MacPorts, once called Darwinports, is a package management system that simplifies the installation of software on Mac OS X and Darwin operating systems. It is a free/open source project designed to simplify the installation of free software/open source software, similar to the goals and features of the Fink and BSD class ports suite. Same as the ports in BSD. MacPorts, like Apt-get, yum, can quickly install some software.

MacPorts Download and Installation

I. Installation via (. pkg): Mac OS X Package (. pkg) Installer

Visit official website: http://www.macports.org/install.php
Http://distfiles.macports.org/MacPorts/MacPorts-2.1.1-10.7-Lion.pkg

Two. Install Macports:source installation via (Source)

1.CD to downloads/directory wget download macports-2.1.1.tar.gz
Input: wget https://distfiles.macports.org/MacPorts/MacPorts-2.1.1.tar.gz

2. Extract macports-2.1.1.tar.gz input: Tar zxvf macports-2.1.1.tar.gz (tar jxvf macports2.1.1.tar.bz2)

3.CD to the extracted directory MacPorts-2.1.1 input:./configure && make && sudo make install installation
Middle prompt input password Complete installation!

7. Then add/opt/local/bin and/opt/local/sbin to the $path search path
Edit/etc/profile file $ sudo vim/etc/profile (privileged edit, Force save exit wq!) At the end of the paper, add the following two sentences

Export Path=/opt/local/bin: $PATH
Export Path=/opt/local/sbin: $PATH

MacPorts Use

The default path for third party software download packages in Port 1.Mac is:/opt/local/var/macports/distfiles/
In order to increase the speed of installation, you can easily copy files from this directory to the same directory in the new Mac port when you install the new port to prevent port from downloading online.

2. The index of port should be updated first before using Mac port
Input: $ sudo port-v selfupdate (it is highly recommended to use the-v parameter for the first run to show detailed update procedures)

3. View the currently available packages in Mac port and their version input: $ port List

4. View updated software and version input: $ port Outdated

5. Upgrade can be updated with the software input: $ sudo port upgrade outdated

6. In the Mac port search needs to install the package input: $ port Search maven

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. After searching for the packages that need to be installed, how to view the contents and instructions of the specific packages
Input: $ port Info Maven3

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 and all the artifacts
Produced by Maven are a result of consulting a
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. View dependencies for the software packages that are about to be installed or installed
Input: $ port Deps Maven3

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

9. View installation to allow custom input parameters: $ port variants Maven3

Maven3 has no variants

10. Review the contents and description of the package and confirm that you are sure you want to install it, enter: $ sudo port install Maven3

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. Uninstall software input that has been installed with Mac Port: $ sudo port uninstall Maven3

---> Deactivating maven3 @3.0.4_0
---> Cleaning maven3
---> Uninstalling maven3 @3.0.4_0
---> Cleaning maven3

macports Uninstall Deletes

1. Uninstall the original MacPorts (if you do not install, skip this step directly, enter: $ port version view)
# The original use of MacPorts installed software in the/opt/local directory, before removing the best view, the number of hearts.

sudo port-f uninstall installed
sudo rm-rf  [/plus each of the following]
/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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.