Getting Started

Ryan Schmidt ryandesign at macports.org
Mon Sep 8 01:28:38 PDT 2008


On Sep 6, 2008, at 8:22 PM, Bill Hernandez wrote:

> The first thing to do is select "/Applications/Utilities/Terminal.app"
> and drag it to the dock where you can access it easily. After you
> launch the Terminal from the dock, to make sure MacPorts is installed
> you can try :
>
> ~ $ which port
> ---> /opt/local/bin/port
>
> ~ $ port help
>
> 'port help' will fill the Terminal window, but won't help you much, if
> at all.

If you don't find it helpful, why mention it to a newcomer?

"man port" might be more helpful, or reading the Guide at http:// 
guide.macports.org/


> You can try :
>
> ~ $ sudo port -d selfupdate
>
> This previous command will update MacPorts itself. The '-d' means do
> the update in the "debug mode". i.e. echo boatloads of info to the
> screen, you can also use '-v' which stands for "verbose mode".

Because boatloads of info are output, it's more helpful for the  
newcomer not to use the -d or -v flags. Just run "sudo port selfupdate"


> Your best bet is to purchase 'PortAutority.app' and slowly begin to
> learn about MacPorts with the goal to eventually do most everything
> with the Terminal. For me it has a lot more power, but took a while to
> figure out.

Instead, I would think the best bet is to read the Guide, understand  
how MacPorts works, and use the "port" command in the Terminal to  
manage your ports. As far as I'm concerned, that is the only  
supported way of using MacPorts -- the only way we can help you on  
the mailing list. If you use someone else's GUI client, you'll have  
to get help through the author of that GUI client.


> Google 'macports documentation' and that should give you several
> places to begin.

You don't need Google; you just need our official web page and  
documentation, which are, as you pointed out:

> Checkout :
>
> http://www.macports.org/
> http://guide.macports.org/


> Try Google 'macports php'as an example and you'll find some links to
> help

I would rather suggest that you peruse the How-To documents in the  
MacPorts wiki:

http://trac.macports.org/wiki/howto

I would prefer for documentation about MacPorts to exist on the  
MacPorts web site. If our documentation is insufficient, please  
correct it by amending the appropriate wiki page, or adding a new  
wiki page, or filing a ticket requesting the Guide be updated.


> You can Google 'PortAutority.app', buy it, it will get you up and
> going quickly. It's a bargain...

MacPorts itself is a bargain and costs $0. You don't need to buy  
anything to use it to its fullest extent. Now, if you're  
uncomfortable with the Terminal, then a GUI may help you, though I  
have not used any MacPorts GUI and cannot vouch for the  
functionality, easy of use, value or any other aspect of any of them.


> Once you install a few items with 'PortAutority.app' you can use the
> Terminal to issue some commands like :
>
> ~ $ port installed
> ~ $ port list installed

There is probably no reason to ever run "port list installed"; it  
probably does not do what a beginner or a casual MacPorts user would  
expect. (It lists the current version of every installed port, even  
if that is not the version that is installed.) "port installed" is  
probably what you always want. (It lists the port versions that are  
actually installed.)


> About the same time, or shortly thereafter, that I started with
> MacPorts I got hit by a Trojan Horse that damaged, several machines,
> including servers, etc. This forced the shutdown, isolation, re-
> initialization of the OS on all the machines, backups, etc. It took a
> while to get all the issues resolved, until I finally found and
> eradicated the trojan.

This information seems irrelevant to helping a new user get started  
with MacPorts.


> One of the biggest problems I ran into when I started was that anytime
> I installed the operating system on any of the machines, it took a lot
> of time to get all the ports installed, initialized, and running
> (particularly the databases). Eventually I wrote a shell script that
> installs, initializes all the databases, creates symlinks, makes
> backups of things like php.ini, my.cnf, pg_hba.conf, httpd.conf, all
> the apache virtual host files, etc.
>
> I do not keep any of the php.ini, my.cnf, pg_hba.conf, httpd.conf, all
> the apache virtual host files, etc. in the standard locations  
> within '/
> opt/local/...', instead I keep all the configuration files in another
> directory unrelated to '/opt/local/...', thus the reason for the
> symlinks. The nice thing about this is that if anything gets majorly
> hosed for whatever reason, I can run the shell script which backs up
> the databases, shuts down everything, deletes the '/opt/local/...'
> directory, re-installs MacPorts, and all the ports I need, re-
> initializes everything, restarts all the apache and associated pieces,
> restores the databases, and for the most part everything is back up
> and running very quickly. This was an important goal for me, to
> automate rebuilding all the MacPorts installs.

It really should not be necessary to reinstall MacPorts on a regular  
basis, so this does seem like overkill. Not something a new user  
should need to burden themselves with.

I will say that I do store my MySQL databases outside of the default  
location within /opt/local; I have them in my home directory. I also  
have my Subversion repositories and web sites in my home directory.  
Somehow it feels better to have my data in my home directory. It's  
unlikely you'll accidentally lose something in your home directory,  
but a friend of mine (who seems to get a new computer yearly) has on  
more than one occasion lost his MySQL databases because he forgot  
they existed, used Migration Assistant to copy data to his new  
machine (which did not copy his databases or anything else that was  
in /usr/local), and erased and sold the old machine before realizing  
these critical items had not been copied. YMMV.


> I have gotten a lot of help on this board, it has been great. I mostly
> lurk as there are others that know far more, but this seemed like
> something I could reply to...
>
> Depending on your needs, you will most likely need some variants which
> provide additional functionalities to some of the ports.

This is good advice. Check "port variants foo" before installing port  
foo to see if it has any variants you want.


> Whatever you do, don't give up on MacPorts, it is an awesome, and
> successful effort by some amazingly talented, and dedicated people to
> help the rest of us ordinary mortals...
>
> I added a couple of small shell scripts below for you, they may be
> overkill for you now, but at least you'll have them for later...


[snip]



More information about the macports-users mailing list