I see this with a user encountering a similar error: https://lists.macports.org/pipermail/macports-users/2013-November/034019.html
> The xinit portfile explicitly requests to be installed as root (it contains the line “install.asroot yes”). On Wed, Jul 2, 2025 at 11:26 PM Nick <[email protected]> wrote: > I'll try these options, so far during 'port install xorg' the installation > fails requiring root privileges to complete installation of 'xinit. > > On Wed, Jul 2, 2025 at 7:40 PM Dave Allured - NOAA Affiliate via > macports-users <[email protected]> wrote: > >> Nick, I am glad you figured out before I had to type too much. ;-) >> >> Please refer to: >> https://guide.macports.org/#installing.macports.source.multiple (section >> 2.2.4) and observe several rules. In particular it looks like you are >> still missing *--with-applications-dir=XXX* and*--without-startupitems*. >> >> Also on my controlled Mac where I do not have any admin privileges, I do >> not use *--with-install-user* or *--with-install-group*. I simply run >> configure while logged in as the desired user and group. >> >> >> On Wed, Jul 2, 2025 at 5:11 PM Nick <[email protected]> wrote: >> >>> Found the issue, my PATH was pointing to an older macports binary which >>> used different macports.conf! No help required now. >>> >>> On Wed, Jul 2, 2025 at 6:57 PM Nick <[email protected]> wrote: >>> >>>> My proposal here is to create a new user account for macports and >>>> development work. Logged into this account 'mp0' I tried: >>>> >>>> ./configure --with-no-root-privileges --prefix=${HOME]/mp-install >>>> --with-install-user=mp0 --with-install-group=mp0 >>>> make >>>> make install >>>> >>>> However, now when I try to install a port I get an error that macports >>>> has insufficient privileges to write to the install directory. I can touch >>>> files in this directory without any error. >>>> >>>> Does anyone have suggestions on resolving this? >>>> >>>> I created the account using dscl, not sure if there is something that I >>>> should be aware of doing this. >>>> >>>> Thanks! >>>> >>>> On Wed, Jul 2, 2025 at 5:16 PM Nick <[email protected]> wrote: >>>> >>>>> What are best practices in sandboxing MacPorts to a non-admin user >>>>> account and still retaining the ability to use XQuartz? >>>>> >>>>> For instance, I would like to invoke all applications as a certain >>>>> user, without administrative privileges, however at the same time still be >>>>> able to use XQuartz graphically from my privileged account. I was hoping >>>>> XQuartz could be installed specific to this non-admin user as well. >>>>> Unsure >>>>> if such isolation is possible. >>>>> >>>>> I'm doing some sandbox testing. I see a 'macports' user, however in >>>>> my first installation many of the files in /opt/local are owned by root. >>>>> I >>>>> was hoping to install a specific to a user account for all MacPorts. >>>>> >>>>
