📜 ⬆️ ⬇️

Installation and work with package manager for Mac OS X (MacPort and Homebrew)

The package manager in Mac OS X will allow us to work easily with third-party packages. In this topic, we consider two such managers: MacPort and Homebrew.


1. MacPort


Official website
On the same site you can find the Mac OS X Package (.pkg) Installer for Mountain Lion, Lion, Snow Leopard and Leopard. Install the right package for your health. There are other ways to install, but we chose simple and fast. On the chevo case, my port was installed here: / opt / local / bin / port.

Demand:


')
Working with the port is very simple - we are looking for the necessary package in the “ports” and install it:
$ port search php5 php-eaccelerator @0.9.6.1 (php, www, devel) php5 extension for PHP acceleration, optimization, and dynamic content caching php-xdebug @2.2.1 (php, net, devel) php5 extension for php debugging php5 @5.3.15 (lang, php, www) PHP: Hypertext Preprocessor php5-amf @0.9.2 (php, devel) ActionScript Message Format extension php5-apc @3.1.9 (php, devel) Alternative PHP Cache ... $ sudo port install php5 


Additional commands:

 $ port list -    $ sudo port -v selfupdate -    $ sudo port upgrade outdated -        $ port deps nano -     Full Name: nano @2.2.3_0 Library Dependencies: ncurses, gettext, libiconv $ port contents nano -     $ port installed -      $ port dependents erlang -   ,    erlang $ sudo port uninstall nano -     nano 


2. Homebrew


Official page
About Homebrew talk more ...

Demand:



Installation:

 $ ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go) 


After successful installation, execute the following command:
 $ brew doctor 


If, as a result of this command, we get the answer: “Your system is raring to brew” , then everything is fine and you can safely begin working with brew. Otherwise, continue ...

If the Error Warning: Experimental support for using Xcode without the “Command Line Tools” occurred, the “axis” was most likely updated, for example, from Lion to Mountain Lion, but the Command Line Tools for Xcode was not reinstalled.

If the error Error: No such file or directory is / usr / local / Cellar , you need to create this directory:

 $ sudo mkdir /usr/local/Cellar 


After that, run the command again:

 $ brew doctor 


If we get something like this:
 Warning: Your Xcode is configured with an invalid path. You should change it to the correct path. Please note that there is no correct path at this time if you have *only* installed the Command Line Tools for Xcode. If your Xcode is pre-4.3 or you installed the whole of Xcode 4.3 then one of these is (probably) what you want: sudo xcode-select -switch /Developer sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer DO NOT SET / OR EVERYTHING BREAKS! 


then we correct with an example like this:
 $ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 


Check the following times:
 $ brew doctor 


If this time there were no errors, then all - you can safely work with Homebrew.

Work with Homebrew:

 $ brew search git -  $ brew info git -    $ brew install git -   $ brew update -  Homebrew ( git) $ brew list -    $ brew uninstall git -   $ brew outdated -  ,     


Push:


I would advise you to forget about MacPort and work with Brew, since MacPort hurts a lot of dependencies, and re-installs them all, regardless of whether there is a need or not.

Source: https://habr.com/ru/post/151023/


All Articles