Another getting started thread

Ryan Schmidt ryandesign at
Sat Sep 13 23:04:26 PDT 2008

On Sep 13, 2008, at 11:55 PM, David I wrote:

> Hi, I'm totally new.

Welcome to MacPorts!

> I'm quasi-computer savvy, but I really don't
> know anything at the coding/command line level or below.  I've been
> getting a couple of strange errors that don't seem to be documented,
> and I have a few questions that need answering.
> First error:  When trying to run the command I got from this page:
> that allows some stuff that I don't really understand (including the
> port [and apparently sudo] command [s]), I get this:
> *************************
>> [Users/Pfhortipfhy] > curl -O 
>> macports/branches/release_1_6/base/portmgr/dmg/postflight && bash  
>> postflight
> Usage: port
>        [-bcdfiknopqRstuvx] [-D portdir] [-F cmdfile] action
> [privopts] [actionflags]
>        [[portname|pseudo-portname|port-url] [@version] [+-variant]...
> [option=value]...]...
> "port help" or "man 1 port" for more information.
> logout
>> [Process completed]
> *************************
> At which point it locks me out, I can't even type.  I assume that
> there's a way to log back in, but that seems like it shouldn't be
> logging me out.  Also, I get none of the error messages that the other
> page talked about:
> *************
> This will set up your .profile for you. After the .profile is set up,
> the script will attempt to run sudo port selfupdate but will fail.
> This is normal in this case. Please ignore the permission errors the
> rsync process will print. When the script finishes, you should run
> sudo port selfupdate manually.
> ************
> It's kind of hard to run selfupdate when I can't type.
> It also locks me out after typing "selfupdate" just by itself:
> ***********************
> [Users/Pfhortipfhy] > selfupdate
> Error: /opt/local/bin/port: port selfupdate failed: Couldn't sync the
> ports tree: Synchronization the local ports tree failed doing rsync
> logout
> [Process completed]
> ***********************
> Strange indeed.

When you open the Terminal application in /Applications/Utilities, or  
when you start a new Terminal window by choosing New Shell from the  
File menu of the Terminal application, it starts a shell for you. A  
shell is a program that lets you type commands. On Mac OS X your  
shell is usually bash. If your Mac OS X user account was created in  
Mac OS X 10.2 or earlier, then your shell might be tcsh.

"[Users/Pfhortipfhy] >" is not a usual prompt for bash or tcsh. It  
is, however, the prompt that the port command gives when in  
interactive mode. It sounds like somehow you have set your Terminal  
to run the port command every time you open a new Terminal window!  
This is not usual and not recommended. You will surely need to on  
occasion run commands other than port commands in your Terminal.

If you're on Mac OS X 10.4, you can look in the Terminal Preferences  
(Terminal menu > Preferences) and see what it's set to execute when  
you make a new Terminal window. It has options to either "Execute the  
default login shell using /usr/bin/login" (this is the option I have  
selected) or "Execute this command (specify complete path):". Have  
you perhaps selected the latter radio button and entered the path to  
the port command (/opt/local/bin/port)? If so, re-select the first  
radio button instead, close your Terminal windows, and make a new  
one. You should now be in bash (or perhaps tcsh) from which you can  
execute any command you like, including the port command.

If you're using Mac OS X 10.5, things may look different; I know  
Apple re-tooled Terminal a bit for Leopard. If you can't find where  
to look, let us know.

The command from the ProblemHotlist to set up your .profile -- the  
one beginning with "curl" -- is a shell command, not a port command,  
therefore the port command did not understand what to do with it,  
therefore it printed its usage message and exited.

Whenever MacPorts 1.6.0 encounters a problem in interactive mode, it  
exits. Therefore, your Terminal window said "[Process exited]" and  
did not allow any further input. Incidentally, MacPorts 1.7.0 and  
later in interactive mode will not terminate in this way; it will  
print an error and keep running until you tell it to exit.

> The specific port that I'm trying to install is rrgbis, under the  
> games section.
> When trying to install with porticus, all of the libraries but smpeg
> compiled installed.  I then tried with PA, and I got a "rrgbis as been
> installed, look at box for details" message in growl, but alas, the
> log box was blank.  When I look at the "Installed" section, all of
> rrgbis' required libraries are there, but rrgbis isn't.  When I do the
> port files command on rrgbis, it tells me that it's not installed.

I'm afraid I can't help with Porticus; I've never seen it.

> This is the error message that I get when trying to install rrgbis
> right off the bat in terminal:
> *************************
> [Users/Pfhortipfhy] > install rrgbis
> Error: Unable to execute port:
> /opt/local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync.macports.org_release_ports_games 
> _rrgbis/work/.macports.rrgbis.state
> is not writable - check permission on port directory
> [Users/Pfhortipfhy] >
> *************************

In the default setup, you must use "sudo" before the port command to  
run it as the superuser ("sudo" stands for "SuperUser DO"). Without  
sudo, you don't have permission to install things. As above, your  
Terminal appears to be set up to run the port command for you every  
time, and it's doing so normally, not using sudo.

> What's going on here?  Can anybody tell me what I'm doing wrong, so
> I'll be able to set up this famed "one command download" feature that
> I hear about?

"Famed 'one command download' feature"? Are you just referring to the  
fact that "sudo port install foo" is all you need to do to download  
and install foo? If so, then yes, that's very nice, and one of the  
key features of MacPorts. :)

> Also: My question:  Some ports (like rrgbis) say that they need
> Darwin.  I'm confused because I thought that Darwin was a
> collaboration of Open Source Projects combined into (and added onto)
> to make various Mac OS's.  If so, how is the platform "Darwin"
> different from the platform "Mac OSX".  If it's a standalone OS, where
> would I get it?

Right, Darwin is the open-source heart of Mac OS X. Its source is  
available here, if you're interested:

"platforms darwin" in a port should mean that it will run on pure  
Darwin or on anything based on Darwin (such as Mac OS X). "platforms  
macosx" should mean that the port requires Mac OS X and will not work  
on pure Darwin.

I don't know of anyone who runs pure Darwin though, and ports are  
therefore not tested on it. This was one of the reasons why the name  
of the project was changed from DarwinPorts to MacPorts -- to  
emphasize its focus on Mac OS X. If you have Mac OS X, you don't need  
to concern yourself with pure Darwin. You already have all of Darwin  
"under the hood."

More information about the macports-users mailing list