MacPorts missing links

Lawrence Velázquez larryv at macports.org
Sat Sep 10 11:38:28 PDT 2016


> On Sep 10, 2016, at 1:42 PM, David Epstein <David.Epstein at warwick.ac.uk> wrote:
> 
> I gave the command:
> 
> ls -l /opt/local/bin/py*
> and the system replied:
> 
>> lrwxr-xr-x  1 root  wheel  23  9 Jun 19:13 /opt/local/bin/pydoc@ -> /opt/local/bin/pydoc2.7
>> lrwxr-xr-x  1 root  wheel  23  9 Jun 17:19 /opt/local/bin/pydoc3@ -> /opt/local/bin/pydoc3.5
>> lrwxr-xr-x  1 root  wheel  24  9 Jun 19:13 /opt/local/bin/python@ -> /opt/local/bin/python2.7
>> lrwxr-xr-x  1 root  wheel  31  9 Jun 19:13 /opt/local/bin/python-config@ -> /opt/local/bin/python2.7-config
>> lrwxr-xr-x  1 root  wheel  24  9 Jun 17:19 /opt/local/bin/python3@ -> /opt/local/bin/python3.5
>> lrwxr-xr-x  1 root  wheel  31  9 Jun 17:19 /opt/local/bin/python3-config@ -> /opt/local/bin/python3.5-config
>> lrwxr-xr-x  1 root  wheel  25  9 Jun 17:19 /opt/local/bin/python3m@ -> /opt/local/bin/python3.5m
>> lrwxr-xr-x  1 root  wheel  32  9 Jun 17:19 /opt/local/bin/python3m-config@ -> /opt/local/bin/python3.5m-config
>> lrwxr-xr-x  1 root  wheel  25  9 Jun 19:13 /opt/local/bin/pythonw@ -> /opt/local/bin/pythonw2.7
>> lrwxr-xr-x  1 root  wheel  25  9 Jun 17:19 /opt/local/bin/pyvenv@ -> /opt/local/bin/pyvenv-3.5

Those are symlinks created by "port select". Presumably you set up the python, python2, and python3 select groups at some point.

> You will see that none of the files on the righthand side of the arrow -> appears on any lefthand side. I tried “port provides” on both lefthand and righthand sides and received error messages from port such as
>> /opt/local/bin/pydoc2.7 does not exist.

Did you uninstall python27?

> and
>> /opt/local/bin/pydoc is not provided by a MacPorts port.

Right, because that file was created by "port select" and not a port.

> How do I get rid of the symbolic links, other than using /bin/rm, something I have been told never to do?
> 
> How can I find all hanging links like this in /opt? Presumably there is a clever formula using unix find.

Try running "port select --summary" (although I'm not sure whether this feature has been released). It will list the select groups on your system and their current settings. If any of those settings corresponds to a port you have uninstalled, you should be able to remove the symlinks with

	sudo port select --set python none
	sudo port select --set python2 none
	sudo port select --set python3 none
	etc etc etc

> I wonder what causes this kind of problem? I cannot remember any of my port processes terminating incorrectly. I have lately been uninstalling python-related ports, because I had too many different versions of python on my machine, and I was getting confused.

The symlinks created by "port select" are not modified if the selected port is subsequently deactivated or uninstalled. I think there is an open ticket about this, but I can't find it at the moment.

vq


More information about the macports-users mailing list