Opened 3 years ago

Closed 3 years ago

#63048 closed defect (worksforme)

Big Sur - MacPorts can't install python to "/Applications/MacPorts"

Reported by: cpragman Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port:

Description

On Big Sur, Gatekeeper is preventing MacPorts from installing things in the /Applications directory. To work around this, I've updated /opt/local/etc/macports.conf to specify application_dir to be /opt/local/Applications/MacPorts. However, despite this change to the config file, MacPorts still tried to install python to /Applications/MacPorts.

Error: Failed to activate python39: can't create directory "/Applications/MacPorts": not owner Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port youtube-dl failed

Change History (6)

comment:1 Changed 3 years ago by kencu (Ken)

Interesting.

Not happening to me, or anyone else I believe.

Wonder what is going on on your system?

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Any ports you already installed with the old setting will still have their files in the same locations. You would need to uninstall all ports that put files in applications_dir and install them again to pick up the new setting.

As Ken said though, I'm not aware of any other reports of installing to /Applications/MacPorts being blocked on Big Sur.

comment:3 Changed 3 years ago by cpragman

My experience w/ Big Sur so far is that unless I'm installing signed apps, it won't let me make any other modifications to the contents of the /Applications folder unless I reboot into Recovery and turn off Gatekeeper. I'd rather leave Gatekeeper on, so that is why I've set a custom folder for MacPorts applications in the config file /opt/local/Applications/MacPorts

I deleted everything per the instructions here - https://guide.macports.org/chunked/installing.macports.uninstalling.html Then verified /opt/local/etc/macports.conf has application_dir set to /opt/local/Applications/MacPorts Then reinstalled macports from the MacPorts-2.7.1-11-BigSur.pkg Ran $ sudo port selfupdate Then tried to install youtube-dl. $ sudo port install youtube-dl

It progresses, up until it gets to Python39, at which point it fails... ---> Installing python39 @3.9.5_0 Error: Failed to install python39: no destroot found at: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/destroot Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port youtube-dl failed

Looking at the log file for Python39 [ /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/main.log ]

I see that it is still trying to install Python into /Applications/MacPorts, instead of /opt/local/Applications/MacPorts. The OS is denying write access to /Applications/MacPorts.

Python39 Log excerpt: :debug:activate activating directory: / :debug:activate activating directory: /Applications :debug:activate activating directory: /Applications/MacPorts :debug:activate Activation failed, rolling back. :error:activate Failed to activate python39: can't create directory "/Applications/MacPorts": not owner :debug:activate Error code: POSIX EPERM {not owner} :debug:activate Backtrace: can't create directory "/Applications/MacPorts": not owner

comment:4 Changed 3 years ago by kencu (Ken)

the no destroot found issue could be it.

Please try this:

sudo port clean python39
sudo port -f uninstall python39
sudo port -v install python39

see 55445#comment:8

comment:5 Changed 3 years ago by cpragman

That did the trick! Thanks!

comment:6 Changed 3 years ago by kencu (Ken)

Resolution: worksforme
Status: newclosed

+1

at present, there is no enduring fix to be had for this rare but intermittent and sporadic problem.

Note: See TracTickets for help on using tickets.