Warning: These notes are mostly plagarized from some other website but I wanted them on mine for easy lookup.,
sudo port selfupdate
sudo port upgrade
sudo port install vile
port search 'vile'
The search facility uses standard regular expression syntax, so you can also do much more complex searches. Additional Steps: fetch, configure, build, destroot, install
Once the port has been installed, you may want to delete all the intermediate files that DarwinPorts has created while building the port. To do this, simply use the clean option:
port clean vile
port clean --all vile
Getting Information about a Port
port info vim
port search '.+'
port list
port installed
port installed
port outdated
port contents vile
Variants and Dependencies
Before you install a port, you may want to check what variations of that port are available to use. Variants provide additional configuration options for a port. To see what variations a port has, use the variants option: port variants vile
You also may want to see what dependencies a port has. You can use the deps option to check: port deps vile
If you want to find out which ports depends on a port you have installed, use: port dependents gettext
For more information you should look at the port manpage by entering: man port. The portindex command
Most of the time you won’t need to use this command as it is used to build the index of all the available ports, but sometimes the index you have is out of date or innacurate for some reason. When this occurs you will get an error message like ‘port search failed: expected integer but got “PortIndex”’. You can fix problem by moving to the dports directory (/Users/mike/darwinports/dports in our examples) and executing: portindex. This will go through all the available ports in the dport directory and build an index file called PortIndex.
Removing ports
Ports are removed using the port command described above, simply execute the command: sudo port uninstall vile
Upgrading ports
You can check if a port is outdated with the following command: port outdated gnome
To check if you have any outdated ports: port outdated
To upgrade a port execute: sudo port upgrade gnome
This will deactivate the old version and install the new, and also install the newer versions of the dependencies of the port.
If you would like to upgrade the port, but not the dependencies of the port, you can: sudo port -n upgrade gnome
To upgrade all installed ports simply do: sudo port upgrade installed
If you dont like that upgrade just deactivates the old version of the port, you can get it to uninstall the old version by using the -u option: sudo port -u upgrade gnome
Using force
While upgrading you can run into cases when you have to use force (-f). This is especially true if you are upgrading a port that wants to install a file that another port allready has installed, or if you use the -u option to upgrade (and uninstall) a port that could be installed as a dependency. Allways remember to use the -f option with caution.