This repository has been archived on 2023-07-05. You can view files and clone it, but cannot push or open issues/pull-requests.
notes/Terminal Tips/Shells/Computers (operating system)/Apple Macbook/MacPorts.md

1.5 KiB

An alternative package installer to the more popular Homebrew though much older. The project started in 2002 as an initiative from Apple employees to install UNIX packages. Similar to Fink, Homebrew and BSD ports collections.


Installing


To install a package:

sudo port install packagename

Update outdated ports:

sudo port selfupdate
sudo port upgrade outdated

By default, MacPorts does not collect any statistics. However, users can optionally submit information by running:

sudo port install mpstats

Searching available package:

port search --name --glob 'git*'

List outdated packages:

port outdated
sudo portupgrade outdates

##or for specific things
sudo port upgrade gnupg2

List installed packages

port installed

Looks at contents of port:

port contents portname

Contents is helpful for finding the location of a port's executable after installing it

port -q contents _`portname`_ | grep -E '/s?bin/

Uninstalling


Uninstalls a package

sudo port uninstall portname

Typically packages will also have dependent packages that were installed as well.

#to tag dependent packages
sudo port uninstall --follow-dependents portname

List which ports depend on a given installed port.

port dependents openssl

References:


For further info, refer to either the MacPorts Guide or official Wiki