16 March 2010

apt-get install yum install on MAC OS X


The reason we bought a mac in the first place was:

1. We get the benefits of Linux
2. With a usable windowing system
3. And it's sexy

So we do a little searching and find out that our little dream is shattered as we have no apt-get install, nor any yum-install.

It's not all that bad. There is good news. There is software called Macports, where the good open sourrce folk have ported a lot of the Linux software to Mac/Darwin. This includes good ol utilities such a rsync, postresql, postfix, mysql and friends...

Unfortunately, it's not just as simple as downloading the MacPorts .dmg file and installing it. Because apt-get and yum typically download source code and compile it for your system, macports needs to do this too. By default, the GCC compiler doesn't come with your mac, and the ONLY way I've found so far to get it on your system, is to install X-Code, which is pretty the best part of a gigabyte.

Fortunately, xcode is free software and ships with your OS, so stick in your OS X cd and install X-Code. If you lost your OS CD, you can create an ADC (Apple Developer Connection) account, and download X-Code here:

http://developer.apple.com/technologies/xcode.html

Once installed, GCC, Make and related tools will be automatically installed and configured.

Then it's a simple matter of downloading and installing MacPorts. Get the DMG here:

http://www.macports.org/install.php

You may want to run a quick update to make sure everything is set up correctly:

sudo port -v selfupdate

And apart from that, it works just like yum or apt-get.

sudo port install ...

Enjoy the best of linux on your machine, free of charge. Be sure to also check out WINE (Windows Emulator) for a lot of fun running Windows software on your Mac, free, without a copy of VMWare, Windows, nor Parallels!

3 comments:

James said...

Hi Sparky Spider,

Thanks for your blog. So far I've been able to update my macports using sudo port -v selfupdate and have xcode installed.

I'm now trying to follow the instructions from another blog which are

"You will need to install PHP modules for XML and Tidy. On a RedHat/CentOS/Fedora Linux machine, these modules can be installed using the following command:

yum install php-xml php-tidy"

Are php-xml & php-tidy executable using you sudo port install command?

Thanks
James

said...

as you have mentioned, I install xcode and mqcports,after I typed sudo port -v selfupdate, I wanna try sudo port install instead of
"yum install httpd
yum install mod_ssl
yum install httpd-devel" (to install apache,in fact) with the command, it says like:"Error: Port httpd-devel not foundTo report a bug, see ", I donot know what is wrong here.

said...
This comment has been removed by the author.