Re: Wrong installation as normal user – what should I do?

Ryan Schmidt ryandesign at macports.org
Sat Jun 7 14:03:28 PDT 2014


On Jun 7, 2014, at 11:36 AM, nibribus.mdb at xs4all.nl wrote:

> I installed MacPorts while I was logged in as a standard user. I should have done this as the admin user, because I want the stuff that I install to be available for all users on the Mac. During installation I just gave the proper admin user name and password when prompted for it, and installation completed succesfully.

This is fine. MacPorts has been successfully installed.


> Now I am afraid that MacPorts will not work as it should when I use it logged in as the admin user to do further installations.
> 
> Here are  some more details:
> 
> OS version: 10.6.8
> 
> MacPorts version: MacPorts-2.2.1-10.6-SnowLeopard
> 
> Immediately after I discovered the mistake I searched standard user’s home folder for changed files (visible and invisible).  I found only one that had been changed just before, namely .profile. It said:
> 
>> 
> # MacPorts Installer addition on 2014-05-22_at_13:26:30: adding an appropriate PATH variable for use with MacPorts.
> 
> export PATH=/opt/local/bin:/opt/local/sbin:$PATH
> 
> # Finished adapting your PATH environment variable for use with MacPorts.
> 
>> 
> Indeed, when I checked the environment stil logged in as this standard user I got:
> 
> “PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MacGPG2/bin:/usr/X11/bin”
> 
> Now, when I check the environment logged in as admin user I get
> 
> “PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MacGPG2/bin:/usr/X11/bin”.

The MacPorts installer modifies the shell startup file of the user you were logged in as to add the path so that you can easily access MacPorts-installed programs in the terminal. If you want additional users' paths to be modified, do so manually in each of their shell startup files.


> Further, installation seems to have crated a new folder right in the root, named /opt, which contains lots of files created at the installation time, and some older ones that were changed at the installation moment.

Correct, /opt/local is where most MacPorts files get installed. There are a few other locations too, such as /Applications/MacPorts.


> What must I do? The most simple solution to me seems to just install again being logged in as the proper admin user. I imagine that a second installation will simply write a new /opt folder over the exisiting one. Will this do the trick or will it not? And how about this changed PATH of standard user (or maybe other settings for standard user), wil it hurt?

Edit the .profile in the home directory of each user who should have MacPorts programs in their path. Add the line:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

If the file doesn't exist, create it with that one line.

Or, if that user uses a different shell startup file, such as .bash_profile, edit that file instead.

Or, if that user doesn't use bash but instead uses tcsh (this is not common), use tcsh syntax.




More information about the macports-users mailing list