1.7 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
Reclaim disk space:
sudo port reclaim
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
- Here are more common tasks that are often made in MacPorts