Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link to a new gcc version with brew?

I just got a new gcc version by running brew update and brew upgrade. brew complained that brew link did not complete successfully:

~
✓  brew upgrade
==> Upgrading 1 outdated package, with result:
gcc 4.8.2_1
==> Upgrading gcc
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/gcc-4.8.2_1
######################################################################## 100,0%
==> Pouring gcc-4.8.2_1.mavericks.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using:
  brew link gcc

Possible conflicting files are:
/usr/local/bin/gfortran -> /usr/local/Cellar/gfortran/4.8.2/bin/gfortran
/usr/local/share/man/man1/gfortran.1 -> /usr/local/Cellar/gfortran/4.8.2/share/man/man1/gfortran.1 

So I ran brew link gcc manually:

~
✓  brew link gcc
Linking /usr/local/Cellar/gcc/4.8.2... 25 symlinks created

Now when I tell brew to clean up I get the following warning:

~
✓  brew cleanup
Warning: Skipping (old) /usr/local/Cellar/gcc/4.8.2 due to it being linked

There are two gcc version in my Cellar:

~
✓  ls /usr/local/Cellar/gcc
4.8.2   4.8.2_1

Do I need both? I would like to remove the old version. How can I achieve that?

like image 332
Jan Deinhard Avatar asked May 17 '14 06:05

Jan Deinhard


1 Answers

I solved it by running the following commands

brew unlink gcc
brew rm gfortran
brew cleanup
brew link gcc

It seems that gfortran was linked to the old gcc version.

like image 195
Jan Deinhard Avatar answered Oct 01 '22 17:10

Jan Deinhard