MacPorts without root privileges: how?

Ryan Schmidt ryandesign at
Wed Feb 9 12:38:31 PST 2011

On Feb 9, 2011, at 14:34, Gf B wrote:

> I installed MacPorts from source, with the --with-no-root-privileges flag, and configured it so that it uses ~/.macports/opt/local as its $prefix.
> I want to run MacPorts on my laptop *always* without root privileges, because I don't want it to modify anything whatsoever outside of the $prefix mentioned above.
> Still, despite the configuration described above, some installations are failing due to insufficient permissions.
> For example, the installation of Emacs fails because the installation of dbus fails, and the latter fails because of this:
> --->  Installing dbus @1.2.24_1
> Warning: addgroup only works when running as root.
> Warning: The requested group 'messagebus' was not created.
> Warning: adduser only works when running as root.
> Warning: The requested user 'messagebus' was not created.
> --->  Activating dbus @1.2.24_1
> Error: Target org.macports.activate returned: error copying "/Users/user531/.macports/opt/local/var/macports/software/dbus/1.2\
> .24_1/Library/LaunchDaemons/org.freedesktop.dbus-system.plist" to "/Library/LaunchDaemons/org.freedesktop.dbus-system.plist":\
>  permission denied
> Error: Failed to install dbus
> I'm fine with setting up the messagebus user and groups "by hand" using sudo, but I do not want MacPorts to put anything under /Library.  What must I do to get MacPorts to use a different location for these files?
> In case I must finish this installation "manually", what must I do so that the installation of ports that depend on dbus do not croak on account of not having this dependency?

Some ports like dbus install system daemons. These daemons have launchd plists that help you start them. These plists must live in /Library/LaunchDaemons, and you need root privilege to write there. You cannot install ports depending on dbus until you have installed dbus. You'll probably have to use sudo to install ports like dbus that install system daemons.

More information about the macports-users mailing list