如何通过brew链接到新的gcc版本? [英] How to link to a new gcc version with brew?

查看:192
本文介绍了如何通过brew链接到新的gcc版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过运行 brew update brew升级获得了新的gcc版本。 brew抱怨 brew link 没有成功完成:

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 

因此,我手动运行 brew link gcc

So I ran brew link gcc manually:

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


的符号链接

现在,当我告诉brew清理时,我收到以下警告:

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

我的地窖里有两个gcc版本:

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?

推荐答案

我通过运行以下命令解决了这个问题:

I solved it by running the following commands

brew unlink gcc
brew rm gfortran
brew cleanup
brew link gcc

gfortran似乎与旧的gcc版本有关。

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

这篇关于如何通过brew链接到新的gcc版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆