36

I have installed both moria and ettercap using MacPorts (via pallet) and I can't find out where the things were installed to run them!

Where is the install directory?

EDIT: When I install things JUST using macports i.e. from the command line it works.

Pallet doesn't actually seem to install things :S

5 Answers 5

31

If you use contents, it will tell you where they are.

2
  • 5
    port contents only works on installed ports, FYI.
    – chiggsy
    Commented Apr 5, 2012 at 18:37
  • when I use the command i just get Port ettercap-ng does not contain any files or is not active. I clicked the install button inside pallet...
    – RNs_Ghost
    Commented Apr 5, 2012 at 18:41
31

Unless you performed a custom installation of MacPorts everything installed by MacPorts is located conveniently at

/opt/local 

if you perform a directory listing at that location you should see the structure for port installed programs which should be installed in bin or sbin directories.

user$ ls
bin     etc     include lib     libexec man     sbin    share   var 

As noted in the MacPorts Documentation

2.3. Install MacPorts

If you are using Mac OS X, you should install MacPorts using the Mac OS X package installer unless you do not wish to install it to /opt/local/, the default MacPorts location, or if you wish to install a pre-release version of MacPorts base. However, if you wish to install multiple copies of MacPorts or install MacPorts on another OS platform, you must install MacPorts from the source code.

7

To find where any Unix commandline executable is located, use the which command:

$ which bash
/bin/bash
$ which port
/opt/local/bin/port
3
  • 2
    This won't work if you are trying to find a MacPorts version of a binary which also has a Mac OS version, e.g. which find will return /usr/bin/find whereas if you've installed findutils that version (on my install) goes in /opt/local/libexec/gnubin/find.
    – Michael
    Commented Jan 9, 2014 at 16:42
  • 2
    You cannot use which to find packages installed via ports.
    – Thomio
    Commented Sep 4, 2015 at 0:22
  • 1
    Unless /opt/local/bin is in your PATH (which I presume it is not for the OP, given that it is both a non-standard path on macOS and that the OP asked this question ;]), which won't return anything.
    – Nik Reiman
    Commented Apr 27, 2021 at 16:43
1

Use the "contents" action. For example you want to find the location of the "argon2" port.

  1. Get the port's info using "port installed":
$port installed

The following ports are currently installed:`
  argon2 @20190702_1 (active)
  bzip2 @1.0.8_0 (active)
  gettext @0.19.8.1_2 (active)
  gsed @4.8_0 (active)
  icu @67.1_4 (active)
  libedit @20210216-3.1_0 (active)
  libiconv @1.16_1 (active)
  libxml2 @2.9.10_1 (active)
  mhash @0.9.9.9_1 (active)
  ncurses @6.2_1 (active)
  pcre2 @10.36_0 (active)
  php73 @7.3.27_0+libedit (active)
  php73-phalcon3 @3.4.5_0 (active)
  php_select @1.0_0 (active)
  xz @5.2.5_0 (active)
  zlib @1.2.11_0 (active)
  1. Get the port's name and version/variants from the results. In this case "argon2 @20190702_1".

  2. Then run the "content" action.

$port contents argon2 @20190702_1
    
Port argon2 contains:
  /opt/local/bin/argon2
  /opt/local/include/argon2.h
  /opt/local/lib/libargon2.1.dylib
  /opt/local/lib/libargon2.a
  /opt/local/lib/libargon2.dylib
  /opt/local/lib/pkgconfig/libargon2.pc
  /opt/local/share/man/man1/argon2.1.gz

The result shows the locations for the port's related files. In this case the "argon2" file located at "/opt/local/bin/argon2".

Hope this helps.

-1

Yes, you have to explicitly point to the new app to get it to run:

/opt/local/bin/openssl -- in my case, otherwise you get the Apple version.

1
  • 1
    Better is put /opt/local/bin in your PATH before /usr/bin
    – mmmmmm
    Commented May 1, 2021 at 8:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .