Install MacPorts under Mac OS X

    MacPorts is a package system with the help of which it is quite easy to download, compile, install free software, various libraries through the terminal, and also update MacOS X and Darwin.

    To perform all of the above actions, if you have MacPorts, just enter in the terminal window

    port install packagename

    where `` packagename '' is the name of the package to be installed .

    But in order for everything to work just as beautifully for you, you need to install this MacPorts.

    Despite the detailed instructions , I still ran into some difficulties in installing this software product, which prompted me to generalize the articles I read.

    If you are going to install MacPorts from source, then this article is not for you. Read Installing MacPorts .



    Xcode



    It is not surprising, but for starters you will need to download the installation package not at all with the name MacPorts, but Xcode, without which MacPorts simply will not install.

    If you have a new Mac OS X, then it’s enough:
    * Download the appropriate installation package for your version of the operating system of the XCode (free for download you must register with Apple's Developer, the Connection )
    * start installing Xcode Tools and install the application using the default settings


    X11



    In this and in the following paragraphs, I advise you to be especially careful, because it was with the incorrect settings of the "X" that everything flew away.

    * start from '' /Applications/Utilities/X11.app '' ('' / Programs / Utilities / X11.app '')
    * in the menu '' Programs '' select the item '' Configure ''
    * double click on the item '' Terminal '', where we change '' xterm '' to '' xterm -ls ''


    Macports



    * download the latest version of MacPorts-1.xxdmg
    * double-click on MacPorts-1.xxpkg
    * install with default settings


    Shell



    We launch the terminal. We enter it

    ls -a

    and look in the result for a file called `` .profile ''

    If there is none, then try to create it:

    nano .profile

    We have a file editing window appeared in the terminal. We write the line into it

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

    Attention: if you have Mac OS X 10.4 Tiger or earlier, then the following line should also be added to the file (in no case do not add it if you have Mac OS X 10.5 Leopard or higher):

    export DISPLAY=:0.0

    Press ctrl + O to save the file.

    If you already have such a file, then do the same thing, adding the lines described above to the file.

    For all changes to take effect, you must restart the terminal.

    If everything went well, then when you type in the terminal command

    port

    you should get something like the following:

    MacPorts 1.600
    Entering interactive mode... ("help" for help, "quit" to quit)
    [Users/username] >


    First use



    Let's try to update MacPorts. To do this, run the terminal and enter it

    sudo port selfupdate

    or, to display additional information during the execution, add -d

    sudo port -d selfupdate

    It should be noted that this command is not executed very quickly. Therefore, be patient and do not press extra buttons.

    Sample result: I hope everything went smoothly and, most importantly, everything works.

    DEBUG: Rebuilding the MacPorts base system if needed.
    DEBUG: Synchronizing ports tree(s)
    Synchronizing local ports tree from rsync://rsync.macports.org/
    release/ports/
    DEBUG: /usr/bin/rsync -rtzv --delete-after
    rsync://rsync.macports.org/release/ports/
    /opt/local/var/macports/sources/rsync.macports.org/release/ports
    receiving file list ... done
    ...
    Downloaded MacPorts base version 1.600

    The MacPorts installation is not outdated and so was not updated
    DEBUG: Setting ownership to root
    selfupdate done!




    Resources


    1. MacPorts.org
    2. MacPorts Guide
    3. Installing MacPorts
    4. MacPorts Portfiles

    Also popular now: