$Id: macports.txt 1875 2008-06-19 22:05:27Z mjs $
## HOWTO: Install into a custom location (i.e. not /opt/local)
$ ./configure --prefix=/Ports --with-tclpackage=/Ports/share/macports/Tcl
Without --with-tclpackage, parts of the MacPorts sytem gets
installed into /Library/Tcl/macports1.0, which makes it
difficult to run multiple version of MacPorts simultaneously ([more info](http://lists.macosforge.org/pipermail/macports-users/2007-December/007897.html)).
You may also want to
$ sudo ln -s /Ports/share/macports/Tcl/macports1.0 /Library/Tcl/macports1.0
so that "inferior software" can find the system's MacPorts
installation ([more info](http://lists.macosforge.org/pipermail/macports-dev/2007-August/002504.html)).
## FAQ: Can't install package XXX
Recently, a lot more ports seem to not be specifying their
dependencies correctly. This applies to several of the dependencies
of subversion.
If you have trouble with ncursesw, try installing that by itself, and
then installing subversion. (You may also have success installing
sqlite3 first.)
If you have trouble installing curses, install coreutils first.
It may also help to install with verbose mode (`-d`) turned on--this may
give some clue as to the cause of your problem.
## FAQ: What's the difference between "installed" and "active" ports?
An "installed" port is compiled and ready to be activated, but is not
necessarily "active"--only one version/variant of the same port can be
"active" at the same time. For example, different versions (e.g.
1.2.3, 1.2.4) or variants (e.g. with X11 support, without X11 support)
of the same package might be installed at the same time, but only one
can be "active".
$ sudo port installed
...
slang @1.4.9_0 (active)
sqlite3 @3.5.1_0
sqlite3 @3.5.2_0
sqlite3 @3.5.3_1
sqlite3 @3.5.4_0 (active)
tiff @3.8.2_1+macosx (active)
...
## FAQ: What's the difference between "port list installed" and "port installed"
$ port list installed
This runs the "list" command over the pseudo-portname "installed",
which expands to the installed ports. The output looks like this:
...
readline @5.2.007 devel/readline
slang @1.4.9 lang/slang
sqlite3 @3.5.4 databases/sqlite3
...
Other useful pseudo-ports are "active" and "outdated".
$ port installed
This runs the "installed" command, which outputs the installed ports,
indicating whether they are active or inactive. The output looks like
this:
...
readline @5.2.007_0+darwin_9 (active)
slang @1.4.7_0
slang @1.4.8_3
slang @1.4.9_0 (active)
sqlite3 @3.5.4_0 (active)
...
## HOWTO: Install a package
$ sudo port -c install jed
-c for autoclean mode--removes source/build files after installing
(though not the binary package).
## HOWTO: Turn on debugging/verbose mode
Add -d. e.g.
$ sudo port -d install ncursesw
or
$ sudo port -d selfupdate
## HOWTO: Update/upgrade the "port" command itself
$ sudo port selfupdate
## HOWTO: List outdated packages
$ sudo port outdated
## HOWTO: Update/upgrade all outdated packages
$ sudo port -c upgrade outdated
-c to autoclean (remove build files)
(Adding -u to uninstall non-active ports doesn't work out the
way you'd expect; it seems that other ports may have been built with
dependencies on on the inactive port.)
## HOWTO: Clean (remove) port build files
$ sudo port clean --all installed
Note that this removes build files only; it does not remove "inactive"
ports (e.g. older versions, other variants of the package). See below
for how to remove inactive ports.
## HOWTO: Remove inactive ports
$ sudo port -u uninstall
You might need to add -f (to "force" the uninstall) if other
"inactive" ports depend on it, though you might be able to fix this by
rebuilding all the dependencies:
$ port -fR upgrade $package
## ERROR: "Have you synced your source indexes?"
Run:
$ sudo port -v selfupdate
## FAQ: What are the dependencies of a package?
i.e. what packages does a particular package need?
$ sudo port deps $package
## FAQ: What is a particular package needed for?
i.e. what packages depend on a particular package?
$ sudo port dependents $package
## FAQ: What files does a particular port install?
i.e. what are the contents of a particular package?
$ sudo port contents $package