title: MacPorts Installation -- Shell Commands/Postflight Script
body: <p>I had run the MacPorts installer (2.0.3) for my OS X Leopard (10.5.8) which finished "successfully". Unfortunately the port command was not available so I looked in the MacPorts Guide which says that the installer should have run a so-called "postflight" script that sets the necessary environment variables. I tried to run the postflight script manually (which I downloaded from <a href="https://trac.macports.org/browser/branches/release_2_0/base/portmgr/dmg/postflight" rel="nofollow">here</a>), but the execution fails with the following output:</p>
  
  <pre><code>    Detected the bash shell.
      Your shell already has the right PATH environment variable for use with
      MacPorts!
      Your shell already has the right MANPATH environment variable for use with
      MacPorts!
      Your shell already has the right DISPLAY environment variable for use with
      MacPorts!
      Adding [default] tag to sources.conf if needed...
      couldn't read file "/Contents/Resources/upgrade_sources_conf_default.tcl": no
     such file or directory
      Updating port image format...
      couldn't read file "/Contents/Resources/images_to_archives.tcl": no such file or
      directory
      Synchronizing the MacPorts installation with the project's rsync server...
      -bash: __PREFIX__/bin/port: No such file or directory
      An attempt to synchronize your recent MacPorts installation with the project's
      rsync server failed!
      Please run 'sudo port -d selfupdate' manually to find out the cause of the 
      error.
      You have succesfully installed the MacPorts system, launch a terminal and try it
      out!
      Read the port(1) manual page and http://guide.macports.org for help,
      http://www.macports.org/contact.php if you need to get in touch with The 
      MacPorts Project.
  </code></pre>
  
  <p>Any ideas?                   </p>