Sunday, March 20, 2011

Moving over from Macports to Brew

Good Afternoon everyone today is a wonderful but also a special day b/c today is my birthday. I cannot believe it either blogging on my birthday lol yes i know im pretty geeked out but thats ok
This is a tutorial on how to move over from Macports over to Brew in Mac OSX. For a long time i have been using Macports which in the beginning was the best thing since slice bread but as with everything time can kill or improve an applications performance (Just in my opinion). Well Enough rambling from me let get to it. Here is how i moved from Macports over to Brew.

First: Uninstall(get rid of) Macports by running the following commands:


1. sudo port -f uninstall installed

2. sudo rm -rf \
/opt/local \
/Applications/DarwinPorts \
/Applications/MacPorts \
/Library/LaunchDaemons/org.macports.* \
/Library/Receipts/DarwinPorts*.pkg \
/Library/Receipts/MacPorts*.pkg \
/Library/StartupItems/DarwinPortsStartup \
/Library/Tcl/darwinports1.0 \
/Library/Tcl/macports1.0 \
~/.macports

ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"

Step 2. Install the Brew OSx Package Installer by running the following command:

ruby -e "$(curl -fsSLk https://gist.github.com/raw/323731/install_homebrew.rb)"


Step 3. Once the installer has finished installing
NOTE: The key files for brew are installed in the /usr/local/bin/brew directory
The /usr/local/Cellar directory contains the files of your installed packages.



Step 4. Ok Now that brew is installed the following is an example on how to install an application using the brew command:


brew install mongodb

==> Downloading http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-1.6.3.tgz
######################################################################## 100.0%
==> Caveats
If this is your first install, automatically load on login with:
cp /usr/local/Cellar/mongodb/1.6.3-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist

If this is an upgrade and you already have the org.mongodb.mongod.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/org.mongodb.mongod.plist
cp /usr/local/Cellar/mongodb/1.6.3-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist

Or start it manually:
mongod run --config /usr/local/Cellar/mongodb/1.6.3-x86_64/mongod.conf
==> Summary
/usr/local/Cellar/mongodb/1.6.3-x86_64: 16 files, 83M, built in 2 seconds



Another cool command is the info command within brew check it out:

brew info postgresql

postgresql 9.0.1

http://www.postgresql.org/

Depends on: readline, ossp-uuid
/usr/local/Cellar/postgresql/9.0.1 (1229 files, 25M)

If builds of Postgresl 9 are failing and you have version 8.x installed,
you may need to remove the previous version first. See:

http://github.com/mxcl/homebrew/issues/issue/2510

To build plpython against a specific Python, set PYTHON prior to brewing:
PYTHON=/usr/local/bin/python brew install postgresql
See:

http://www.postgresql.org/docs/9.0/static/install-procedure.html

If this is your first install, create a database with:
initdb /usr/local/var/postgres

If this is your first install, automatically load on login with:
cp /usr/local/Cellar/postgresql/9.0.1/org.postgresql.postgres.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist

If this is an upgrade and you already have the org.postgresql.postgres.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/org.postgresql.postgres.plist
cp /usr/local/Cellar/postgresql/9.0.1/org.postgresql.postgres.plist ~/Library/LaunchAgents
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist

Or start manually with:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

And stop with:
pg_ctl -D /usr/local/var/postgres stop -s -m fast

If you want to install the postgres gem, including ARCHFLAGS is recommended:
env ARCHFLAGS="-arch x86_64" gem install pg

To install gems without sudo, see the Homebrew wiki.

http://github.com/mxcl/homebrew/commits/master/Library/Formula/postgresql.rb

NOTE if you need anything additional information about how to use brew run the following command:

brew help

Well thats all from me going to head out and enjoy the rest of my birthday. :)

No comments:

Post a Comment

Cracking Kerberos Service Tickets (TGS) Using Kerberoasting

As of late I've been spending a lot of time researching and learning different techniques when it comes to attacking Active Directory En...