HOWTO: Perform daily maintenacne operations

a) Install package

sudo port install <pkg_name>

b) Uninstall package

sudo port uninstall <pkg_name>

c) Query package dependencies

sudo port deps <pkg_name>

d) List all installed and active packages

sudo port list installed

e) View all available variants of package

port variants <pkg_name>

HOWTO: Clean up MacPorts installation

a) Remove source and module files

port clean --all all

b) Uninstall inactive ports

sudo port -f uninstall inactive

c) Remove leftover build files

sudo rm -rf /opt/local/var/macports/build/*

d) Remove downloaded files

sudo rm -rf /opt/local/var/macports/distfiles/*

e) Remove archives

sudo rm -rf /opt/local/var/macports/packages/*

f) Delete TAR archives

sudo rm -rf /opt/local/var/macports/software

http://superuser.com/questions/165652/how-can-i-clean-up-my-macports-installation

HOWTO: Select and set GNU compiler

a) View available compiler versions

port select --list gcc

b) Choose required compiler version

sudo port select --set gcc mp-gcc49

HOWTO: Resolve MacPorts installation ‘conflict’

a) Deactivate wxwidgets:

sudo port deactivate wxwidgets

b) Install wxwidgets-devel:

sudo port install wxwidgets-devel

c) Deactivate wxwidgets-devel:

sudo port deactivate wxwidgets-devel

d) Activate wxwidgets:

sudo port activate wxwidgets

http://stackoverflow.com/questions/8561355/resolving-a-macports-installation-conflict

HOWTO: Patch MacPort

a) Remove build directory:

sudo rm -rf $(port dir qt4-mac)

b) Synchronise ports tree:

sudo port sync

c) Clean qt4-mac:

sudo port clean qt4-mac

d) Change to qt4-mac directory:

cd $(port dir qt4-mac)

e) Apply patch:

sudo patch -p0 < PATH_TO/qt4-mac.10.11.diff

f) Install qt4-mac:

sudo port install qt4-mac

https://trac.macports.org/ticket/48129

HOWTO: Install MacPort from manually downloaded TAR archive

a) Download the archive:

sudo wget -O /opt/local/var/macports/distfiles/mesa/mesa-10.5.4.tar.xz \
 ftp://ftp.freedesktop.org/pub/mesa/10.5.4/mesa-10.5.4.tar.xz

b) Download its signature:

sudo wget -O /opt/local/var/macports/distfiles/mesa/mesa-10.5.4.tar.xz.sig \
 ftp://ftp.freedesktop.org/pub/mesa/10.5.4/mesa-10.5.4.tar.xz.sig

c) Install package

sudo port install mesa

http://trac.macports.org/ticket/47314

HOWTO: Install additional headers after XCode update

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

HOWTO: List all files installed by given MacPorts package

sudo port contents <package_name>

https://apple.stackexchange.com/questions/47543/listing-all-files-installed-by-some-macports-package