I installed gcc with homebrew:
$ brew install gcc
I can see the result:
$ brew list
ant gcc go libyaml postgresql tmux
autoconf gdb isl mpfr python valgrind
automake gdbm libevent openssl readline wget
binutils git libmpc ossp-uuid ruby xz
cloog gmp libtool pkg-config sqlite
I also see gcc-4.9
in /usr/local/bin
$ ls /usr/local/bin
...
gcc-4.9
...
The issue is that typing gcc
still refers to the system gcc
$ which gcc
/usr/bin/gcc
I wanted to rename gcc-4.9
to gcc
, but I don't want to break anything in homebrew. Specifically, I'd like to rename it in such a way that homebrew is aware of the change and running brew update
will know to link the newly updated version to the name gcc
in /usr/local/bin
.
Can this be done?
DESIRED BEHAVIOR:
$ which gcc
/usr/local/bin/gcc
$ gcc -v
... version XXX
$ brew update
... new gcc version YYY installed in /usr/local/bin/gcc
$ which gcc
/usr/local/bin/gcc
$ gcc -v
... version YYY
/usr/bin/gcc
to something else and creategcc
symlink to/usr/local/bin/gcc-4.9
. – Mateusz Szlosek Oct 30 '14 at 10:08.bash_profile
that refers to the one I want. Hackish way of doing it, but it works. – aglasser Oct 31 '14 at 21:13