Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#43465 closed defect (invalid)

libusb: Cannot mkdir: Operation not permitted

Reported by: jmailman@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: rwilcox (Ryan Wilcox), tobypeterson, ryandesign (Ryan Carsten Schmidt)
Port: libusb

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I'm trying to install MacPorts on MountainLion.

I'm getting this error:

bash-3.2$ sudo port install libusb +universal
Password:
--->  Extracting libusb
Error: org.macports.extract for port libusb returned: command execution failed
Please see the log file for port libusb for details:
    /opt/local/var/macports/logs/_private_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libusb/libusb/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port libusb failed

Attachments (1)

main.log (23.8 KB) - added by jmailman@… 11 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Port: libusb added

Please attach the main.log file.

Changed 11 years ago by jmailman@…

Attachment: main.log added

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: rwilcox@… toby@… ryandesign@… added
Resolution: invalid
Status: newclosed
Summary: Processing of port libusb failedlibusb: Cannot mkdir: Operation not permitted

Has duplicate #43470.

The log says:

:debug:extract Executing command line:  cd "/opt/local/var/macports/build/_private_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libusb/libusb/work" && /usr/bin/bzip2 -dc '/opt/local/var/macports/distfiles/libusb/libusb-1.0.18.tar.bz2' | /usr/bin/gnutar --no-same-owner -xf -
:info:extract /usr/bin/gnutar: libusb-1.0.18: Cannot mkdir: Operation not permitted
[snip]

We can see from the "_private_opt" portion of the above path that your opt is not at the root of your hard drive but inside the private folder. This should not be, and could have occurred if years ago you installed a version of the Cisco VPN client. We used to have a FAQ entry about this:

wiki:FAQ?version=1#IjustinstalledMacPorts1.2fromthe.dmgandIseemtohavelostallmyinstalledportsakaCiscoVPNatemyMacPorts

but it was deleted many years ago because Cisco fixed the problem in later versions of their installer. Please remove the /opt symlink pointing to /private/opt and put /private/opt back at /opt where it belongs.

comment:3 Changed 11 years ago by jmailman@…

Thank you for this. Indeed I installed VPN client about three computers ago (about 10 years ago probably) and it must have migrated to each subsequent computer I had.

I can see in the Finder that I have an alias opt at the root, that points to another opt folder in my user directory. Are you saying I just delete the alias, and move the opt folder in my user directory to the root level of the hard drive?

If so, then what? Should I again try sudo port install libusb +universal

Or do I do something else first? Thanks in advance.

comment:4 in reply to:  3 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Based on what you showed above, /opt is a symlink (not alias) to /private/opt (not in your user directory). If you think it's actually pointing into your user directory, could you show the output of:

ls -l /opt

comment:5 Changed 11 years ago by jmailman@…

lrwxr-xr-x  1 root  wheel  12 Oct 11  2012 /opt -> /private/opt
Last edited 11 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:6 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Ok, so that's what I expected and matches the FAQ entry I referred to above. You should just need to run the commands shown in the FAQ entry:

sudo mv /opt /opt2
sudo mv /private/opt  /opt

Then you should be able to use MacPorts normally. And later you can delete the orphaned /opt2 symlink.

If there's anything in /opt other than "local" (i.e. if a 10-year-old version of Cisco's VPN still lives there alongside MacPorts), you should probably remove it as it may not work after being moved.

comment:7 Changed 11 years ago by jmailman@…

Uh-oh. Indeed X11 is also in local.

Does that mean I have to reinstall Xcode or command-line tools or something?

comment:8 Changed 11 years ago by jmailman@…

Sorry, I mean X11 is also in /opt

comment:9 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

I believe X11 belongs in /opt/X11 too (not /private/opt/X11) so it should be fine. X11 is Xquartz; it's not related to Xcode.

comment:10 Changed 11 years ago by jmailman@…

Ok apparently this worked. The command sudo port install libusb +universal now runs without error.

I am grateful to you! Thanks.

Note: See TracTickets for help on using tickets.