Changes between Initial Version and Version 1 of FAQ


Ignore:
Timestamp:
Aug 30, 2006, 6:04:25 AM (18 years ago)
Author:
jmpp@…
Comment:

Wiki FAQ migration

Legend:

Unmodified
Added
Removed
Modified
  • FAQ

    v1 v1  
     1== General Questions ==
     2
     3=== When will a Universal version of MacPorts for the new Mac Intel architecture be available? ===
     4
     5Since MacPorts supports OpenDarwin, and OpenDarwin has run on Intel platforms since Mac OS X 10.0 and prior (as NextStep or Next OS), chances are that most of the MacPorts ports will run without problem on Mac OS X Intel. Binary installation of MacPorts on Mac OS X Intel is available since the 1.2.1 release. If you encounter a port that will not work on Intel: This is a bug! Problem is, that many projects need some time to adopt to the new platform and also that most of our developers do not own a Intel-Mac (donations welcome ;)).
     6
     7=== Why is /opt/local the default install location for MacPorts? ===
     8
     9`/opt/local` was chosen so as to avoid stomping on other various installations (e.g. fink uses `/sw` to do the same); `/usr/local` is not a viable choice for several reasons:
     10 1. Some software (especially auto* tools from Gnu) look in `/usr/local` as a default location, which means MacPorts can't be easily isolated when needed
     11 2. `/usr/local` is usually reserved for the given system's admin to install items local to that system, and tends to be a bad choice to have taken over by a non-system port system
     12 3. gcc considers `/usr/local` to be a standard system directory, causing (at least) the include directory to be unable to appear early in the list of include directories, and hence causing DP-installed items to be difficult to use properly for items which need them (where another version is installed elsewhere, like `/usr/X11R6`)
     13Some responses concerning `/usr/local` have [http://www.opendarwin.org/pipermail/darwinports/2004-May/021190.html been aired] on the mailing list over time.
     14
     15=== How do I search the mailing list archives? ===
     16
     17Searchable archives of the MacPorts mailing list are available from [http://www.gmane.org Gmane.org] at http://dir.gmane.org/gmane.os.opendarwin.darwinports.
     18
     19=== How do I remove or uninstall MacPorts? ===
     20
     21MacPorts can be removed by issuing the following command from within Terminal:
     22
     23`sudo rm -rf /opt/local /Applications/DarwinPorts /Library/Tcl/darwinports1.0 /Library/StartupItems/DarwinPortsStartup`
     24
     25Please note that this command removes all software installed using MacPorts as well as MacPorts itself.  This includes configuration files for any ports which were installed; if you need to keep them, back them up before the rm (they should be in `/opt/local/etc`).
     26
     27=== I just installed MacPorts 1.2 from the .dmg and I seem to have lost all my installed ports (aka Cisco VPN ate my MacPorts!) ===
     28
     29'''This issue has been resolved in 4.9. The VPN client installs itself in `/private/opt`'''
     30
     31When you install the latest CiscoVPN Client it copies all the files in `/opt` to `private/opt`, deletes the files in `/opt` and replaces them with a link from `/opt` to `/private/opt`  (and taking a long while to do it). The MacPorts .dmg installer overwrites this link and leaves the `/private/opt/local` no longer "connected" to MacPorts. (If you wondered why it took Cisco VPN 4.7 forever to install, this would be the answer, BTW.)
     32
     33One possibility is to rename the newly installed `/opt` to `/opt2` (and later delete it) and then move `/private/opt` to `/opt` and then reinstall MacPorts 1.2 from the .dmg.
     34
     35Another possibility is to munge the dumbass Cisco VPN installer preprocessing script to '''not do that''' before you install Cisco VPN. You then need to modify one other file after the Cisco installation so that it can find a command line tool it's looking for. Unfortunately, I'm now fuzzy on the exact details.
     36
     37Best of all worlds is to avoid using Cisco VPN. With Cisco's keenly brilliant engineering power amply demonstrated in their installer scripts, do you really want them running a kernel extension, fer crissake?
     38
     39{{{
     40$ ls -l /op*
     41lrwxr-xr-x   1 root  admin  12 Dec  5 12:44 /opt -> /private/opt
     42$ sudo mv /opt /opt2
     43$ sudo mv /private/opt  /opt
     44$ ls -l  /op*
     45total 0
     46drwxr-xr-x    3 root  wheel  102 Nov 17 23:46 cisco-vpnclient
     47drwxr-xr-x   13 root  wheel  442 Dec  5 19:56 local
     48}}}
     49
     50=== What are the folders in `${prefix}/var/db/dports/ for and why do they take up so much space? ===
     51
     52`man porthier` says: "MacPorts runtime data", but it contains some more subfolders:
     53
     54`build`
     55 Is used during the building of ports, usually it contains only empty folders, does not take much space. During the building of a port there is a soft link `${prefix}/var/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports/<category>/<port>/work` pointing to the corresponding folder here.
     56
     57`distfiles`
     58 The downloaded sources of each built port, could be removed with `port clean --dist <port>`.
     59
     60`packages`
     61 Containing the binary archive of each installed port. Could be removed with `port clean --archive <port> <version>+<variant>`. These files are helpfull for uninstalling and later reinstalling the exact same ports (eg. for testing something). Only unpacking the archive is needed and no build will be performed. If these archives are never needed they can be disabled in `${prefix}/etc/ports/ports.conf` with the `portarchivemode` option.
     62
     63`receipts`
     64 Contains detail information about each installed port, eg. which files belong to the port with corresponding checksums.
     65
     66`software`
     67 Contains the installed software itself. If a port is activated its files are hard links in the `${prefix}` folders to the corresponding files here. `port uninstall <port> <version>+<variant>` would remove it from here, but then this port can not be used anymore.
     68
     69`sources`
     70 In the subfolder `rsync.rsync.darwinports.org_dpupdate1` are the MacPorts sources themselves (e.g., for the port(1) command). A `port selfupdate` updates this form the OpenDarwin rsync server.
     71 In the subfolder `rsync.rsync.darwinports.org_dpupdate_dports` are folders for each port category and the ports themselves therein, where the corresponding Portfile and patches are found. `port sync` and also `port selfupdate` update this from the OpenDarwin rsync server.
     72
     73=== I get `Error: checksum (md5/sha1/rmd160) mismatch for port`. What can I do about it? ===
     74
     75MacPorts computes checksums of downloaded files to ensure they aren't corrupted and haven't been tampered with. Each portfile lists the checksums for the files that the port will download (using md5, sha1 or rmb160). If the computed checksum of the downloaded file doesn't match the one listed in the portfile, that means the file you downloaded is not the one the port designer used when creating the port, and so MacPorts stops the installation.
     76
     77The first thing you should do if you get a checksum error is update your ports with `sudo port sync` — can you install the port now? If so, it means somebody else encountered the same checksum mismatch before and already fixed it.
     78
     79If updating doesn't help, then you should attempt to discover why there is a checksum mismatch. There are several possible reasons:
     80
     81 1. ''The file is corrupt''. If it was corrupted by the transfer, download it again (`port clean --dist <portname>` and `port install <portname>`). If it is corrupted on the server, there is not much you can do about it. Open a bug in [http://bugzilla.opendarwin.org/ Bugzilla] and assign it to the port's maintainer. As for solving the problem: if there are other mirrors, try one of them. You can also ask if someone has a complete file they can send you on the MacPorts [http://www.opendarwin.org/mailman/listinfo/darwinports mailinglist].
     82 2. ''The developer has performed a "stealth upgrade"''. Sometimes upstream developers make "stealth upgrades" in which they change the contents of their distribution archive but not its version number, without informing MacPorts of this change. Perhaps the developer has repackaged the distribution with a different archiving program, or has fixed typos in the included documentation or made other presumably minor changes that did not warrant a regular release. This practice is not recommended because of the obvious difficulties it presents to MacPorts and other port systems that compute package checksums. Attempt to get confirmation from the developer of the software that this has occurred. If the developer cannot be reached, attempt to determine yourself whether a stealth upgrade has happened. [http://www.google.com/ Search the Internet] and try to locate the older version of the archive that matches the checksum in the portfile. Also download the version currently available on the developer's site, extract both, and compare the contents (for example with `diff -r -u <old> <new>`). If the changes look minor and benign, or there are no changes at all, then it is safe for you to update the checksum in the portfile, and the port maintainer should be informed of this so that they can make the change official. If you cannot determine whether a stealth upgrade has taken place, ask for help on the [http://www.opendarwin.org/mailman/listinfo/darwinports mailing list].
     83 3. ''The file has been tampered with''. It is perhaps somewhat unlikely yet theoretically possible (and it has happened a few times in practice) that the archive being distributed by the developer (or by a mirror) has been genuinely compromised. If a hacker was able to manipulate the developer's (or the mirror's) server, the hacker could have uploaded a revised archive containing malware (a virus, a trojan horse, a spam-sending platform, etc.) of the hacker's choosing, and you would certainly not want to install such software. You must attempt to determine, as above, whether this has occurred by contacting the developer, or by locating an older version of the archive and comparing them. You can also contact the port maintainer or the [http://www.opendarwin.org/mailman/listinfo/darwinports mailing list].
     84
     85=== Where can I find a GUI frontend for MacPorts? ===
     86
     87Try [http://sourceforge.net/projects/dpgui DPGUI]
     88
     89== Software Questions ==
     90
     91=== When I install the port of PHP 5, MacPorts wants to install Apache 1.3 even though I use Apache 2. What do I need to do? ===
     92
     93Use "variants." The command `port variants <portname>` (where ''portname'' is the port in question) lists available build variations that support differences you may desire. For instance, to install PHP 5 for use with Apache 2 and MySQL, you'd type `port install php5 +apache2 +mysql`.
     94
     95=== When I try to run my compiled DarwinPort, it fails with an error like `Cannot load /opt/local/apache2/modules/libphp5.so into server: Symbol not found: __cg_jpeg_resync_to_restart`. What's wrong? ===
     96
     97It's a bug; [http://bugzilla.opendarwin.org/show_bug.cgi?id=3013 Bug 3013], to be exact. The bug description contains a workaround.''(Note: for Apache, this should be fixed as of September 7th, 2005.)''
     98
     99=== How do I get readline support for DarwinPort's Python? ===
     100
     101For python24, install the py-readline port!
     102
     103=== Will MacPorts link to system libraries rather than its own? ===
     104
     105No, MacPorts maintains its own libraries.
     106
     107=== Why is MacPorts using its own libraries? ===
     108
     109There are several reasons to do so. First, it makes ports more compatible across different versions of Darwin/OS X. If we can rely on e. g. openssl 0.9.8 from MacPorts, we don't have to test every port that needs ssl for every available openssl installation. Apple's software tends to break from time to time (e. g. openssl refuses to build with an old zlib, but Apple shipped the old headers of the vulnerable zlib version). Third reason is up-to-dateness: Apple only features e. g. Python 2.3, not 2.4, with which some software does not work. The drawbacks on this behaviour also are minimal: Wasting 10MB for a Python installation is next to nothing if you have a GB-harddisk and gain consistency all the way in return.
     110
     111=== GNOME has an empty menu ===
     112
     113See the [wiki:Gnome GNOME] section of this Wiki for more information.
     114
     115== Portfile Development and Maintenance Questions ==
     116
     117=== Is it possible to have a dependency on a specific variant of another port? E.g. "postgresql8 +server"? ===
     118
     119No.  The current state of the dependency engine is unable to handle specifying anything beyond "port X requires port Y" or "port X requires a file which can be provided by port Y."  There have been discussions on revamping the engine (see the mailing list archives) but nothing concrete as yet.  This is why the most useful variants really shouldn't be variants at all but rolled into the port itself.
     120
     121=== Why won't `portindex` work? I have a local repository set up ===
     122
     123Your local repository needs the ports to be nested within a category for portindex to work. The [http://www.darwinports.org/docs/ch03s05.html#local_repository Documentation] needs to be updated to reflect this requirement.
     124
     125=== What is the process for becoming a committer? ===
     126
     127The process is pretty much the same as for any other open source project. See [http://www.opendarwin.org/pipermail/darwinports/2005-December/029412.html this email] to the MacPorts mailing list which is more specific. Also have a look at the [wiki:NewCommittersGuide New commiters guide] for what commit access to MacPorts entails.
     128
     129== Runtime Errors ==
     130
     131=== I try to disable a variant, but it just informs me of the proper usage for the `port` command ===
     132
     133When using
     134
     135{{{
     136port <command> <portname> -<variant>
     137}}}
     138
     139the dash in the command is going to be interpreted as an option, hence getting the usage message.  It needs to be escaped away with a double-dash:
     140
     141{{{
     142port <command> <portname> -- -<variant>
     143}}}
     144
     145=== When uninstalling a port I get an error like `port uninstall failed: invalid command name "portuninstall::uninstall"`. What's going on? ===
     146
     147This is a known error caused by left overs from old MacPorts installations, specifically the `${prefix}/share/darwinports/Tcl/port1.0/portuninstall.tcl` file that is no longer in the MacPorts source code (`${prefix}` expanding to whatever path was chosen upon initial installation of MacPorts, `/opt/local` by default).
     148However, a reinstallation of the infrastructure (most commonly through `port selfudpate`) does not remove this file and therefore manual intervention is needed:
     149
     150{{{
     151rm -f ${prefix}/share/darwinports/Tcl/port1.0/portuninstall.tcl
     152port -f selfupdate
     153}}}
     154
     155These steps will remove the stray file and force a rebuild of the infrastructure, overriding the release number comparison done by "selfupdate" between the local copy and the one on OpenDarwin servers.
     156If this workaround does not clear the problem for you, please refer to the [http://opendarwin.org/mailman/listinfo/darwinports main mailing list] with as much information as possible.
     157
     158  Be sure you have the latest MacPorts before removing `portuninstall.tcl`. I had the same problem that I couldn't uninstall ports and so I first ran a `sudo port selfupdate` to get the latest version of MacPorts and removed the tcl file afterwards. But when running `sudo port -f selfupdate` it gave me this error message: `Failed to initialize ports system, couldn't read file "/opt/local/share/darwinports/Tcl/port1.0/portuninstall.tcl": no such file or directory` and stopped working.