I see a few issues from what you posted.
error: unable to unlink old 'Library/Homebrew/test/mach/a.out' (Permission denied)
It seems to me you have a permissions issue perhaps from the leftover previous installation of Homebrew. You should remove all traces of the previous installation before you reinstall.
And Homebrew doesn't want to be installed as root
Why on earth would you want to install homebrew as root? The whole point of the project is to keep homebrew in /usr/local
so that you don't need sudo.
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew.
You should also ensure MacPorts is uninstalled and that you've uninstalled Fink. They could cause issues with software installed by homebrew.
Warning: An outdated version of Git was detected in your PATH.
Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub.
This indicates to me that you still have an old version of Git in your PATH, probably installed with another package manager. OS X Mavericks comes with Git version 1.8.5.1
What is the result of the whereis git
command from the Terminal? usr/bin/git
is the OS X install of Git.
Follow the guides to completely remove previous MacPorts or Fink installs and ensure the old directories are removed from your PATH variable.
PS.
I'll be sad if I can't use Mac OS X as a hacker's Unix
That would make me sad too. :(
I find homebrew invaluable and easy to work with. In summary, it seems you just have old software installed (and perhaps extraneous directories in your PATH) and need to clear it out, check your permissions, and reinstall homebrew from scratch.
Best Answer
I'm not sure with it's like this, but if I compile with
gcc-4.9
(as the gcc version I have instaled is version 4.9.2) instead ofgcc
it works as it should. So the compilation sentence that seems to work isgcc-4.9 -o exec_name program.c
. If someone knows why it is like this I would be interested to know.