MacPorts has stopped running

Ryan Schmidt ryandesign at macports.org
Tue Jan 16 04:49:53 UTC 2018


On Jan 13, 2018, at 16:02, Tom Scott wrote:

> I sorry to send this question to you directly but my Macports question seems not to fit into the unusual cases so I’m not quite sure where to direct it.
> 
> I’m using  MacOS high Sierra 10.13.2 and prior to installing Macports Xcode 9.2 was installed. Macports was successfully installed with the downloaded package installer. Initially Macports  worked fine and several ports were also successfully installed. But after installing further software including  IRAF (sucessfully) and KARMA (unsuccessfully so far), Macports and the installed ports have ceased to work, e.g.
> 
> toms-MacBook-Pro:~ tomscott$  port version
> -bash: port: command not found

This means the "port" command is not in any directory in your PATH.

Lenore has a good theory:

On Jan 14, 2018, at 08:13, Lenore Horner wrote:

> I managed to achieve something similar the other day by creating a .bash_profile which then got read instead of my .profile that had my MacPorts path changes.

That was my first inclination as well. I don't know what IRAF and KARMA are, but maybe they're responsible for creating (or instructing you to create) a .bash_profile or .bash_login file.

Since you use bash, it doesn't matter whether you name your shell init file .profile or .bash_profile or .bash_login, but you should pick just one. Put all of the lines from all of those files into one of the files and then delete the other file(s).


> Also here is the content o the usr/local directory:
> toms-MacBook-Pro:local tomscott$ pwd
> /usr/local
> toms-MacBook-Pro:local tomscott$ ls
> bin		include		karma		lib		man		remotedesktop	share		texlive
> toms-MacBook-Pro:local tomscott$ 

I don't know what's in those bin, include, lib directories. They're not causing this PATH problem, but depending on what's in there they can cause you other problems down the road. See:

https://trac.macports.org/wiki/FAQ#usrlocal


> I’m not sure how to proceed, e.g., would be be harmful to reinstall Macport using the package installer again with out removing the current version or might there be easier ways to try first to get Macports and its ports to run again? Any help would be much appreciated.

Running the MacPorts installer again will reinstall the MacPorts base files and rerun the shell setup. It will not affect your installed ports.

For the shell setup, the installer checks whether you have a .bash_profile file, and if so, adds the MacPorts PATH modifications to it. Otherwise, it checks if you have a .bash_login, and it so, adds to that. Otherwise, it adds to .profile.

So the problem could be that you didn't have a .bash_profile or .bash_login when you initially installed MacPorts, so it modified your .profile. And now for some reason you do have a .bash_profile or .bash_login, which bash is using instead of the .profile. If so, running the MacPorts installer again will fix up your .bash_profile or .bash_login file by adding the MacPorts PATH modifications to it. But you can also just fix it up manually.




More information about the macports-users mailing list