On Jan 27, 2021, at 15:55, Murray Eisenberg wrote:
> 
> Ahh…that helps greatly, thank you!
> 
> I notice that most, or even all, of the commands given it the “2.2.3 Git 
> install” directions at https://guide.macports.org/#installing.macports.git 
> require that I use “sudo”, even though I’m on an admin account. For example, 
> I had to do:
> 
>       sudo mkdir -p /iopt/mports
> 
> and
> 
>       sudo ./configure —enable-readline
>       sudo make
> 
> whereas the only commands listed in those directions indicate the need for 
> sudo only in “sudo make install”.
> 
> Am I doing something wrong?

On my system, /opt is a directory owned by root. Perhaps it is the same on your 
system. As such, yes, you need sudo to be able to create a file or directory 
inside it.

You could set the ownership of the directory that you create to yourself so 
that you can then perform further operations inside that directory as your user 
without sudo.

sudo mkdir /opt/mports
sudo chown yourusername /opt/mports
cd /opt/mports
...

You should not configure and make any software as root or with sudo. Use your 
own user account. Only use sudo to make install.

As the guide says, "For this example, /opt/mports will be used, but you can put 
the source anywhere." For example, you could create a directory inside your 
home directory, which would already be owned by you.



Reply via email to