xcode 在 Mac OS X Yosemite 中完全卸载 gcc?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28475708/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:38:42  来源:igfitidea点击:

Uninstalling gcc completely in Mac OS X Yosemite?

xcodemacosgccclangosx-yosemite

提问by ak94

I am trying to uninstall gcc completely from my mac but unable to do so.

我正在尝试从我的 mac 上完全卸载 gcc,但无法这样做。

Current status :

当前状态 :

  ?  ~  gcc -v
  Using built-in specs. 
  COLLECT_GCC=gcc
  COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin14.0.0 /5.0.0/lto-wrapper
  Target: x86_64-apple-darwin14.0.0
  Configured with: ../gcc-5-20141005/configure --enable languages=c++,fortran
  Thread model: posix
  gcc version 5.0.0 20141005 (experimental) (GCC)

~  which gcc
  /usr/local/bin/gcc

I had xcode installed and I removed that completely and also I tried to uninstall using brew. I think I had two different versions installed one using brew and other directly from hpc.sourceforge.net .

我安装了 xcode 并完全删除了它,并且我尝试使用 brew 卸载。我想我安装了两个不同的版本,一个是使用 brew 安装的,另一个是直接从 hpc.sourceforge.net 安装的。

采纳答案by flyx

Since you have your gccin /usr/local, it is not part of your operating system. The cleanest - but brute force - way is to delete /usr/localcompletely, and then reinstall the things you want to have there. See also here.

由于您拥有gccin /usr/local,它不是您操作系统的一部分。最干净 - 但蛮力 - 的方法是/usr/local完全删除,然后重新安装你想要的东西。另请参见此处

/usr/localis a directory that doesn't come from OSX, but is used by tools like Homebrew. If you delete it, you will lose everything you installed with Homebrew, including Homebrew itself, but you can reinstall it afterwards. You will also lose other tools that install themselves in there. Depending on how much you have there, it may be a quick or a very long procedure.

/usr/local是一个不是来自 OSX 的目录,但被 Homebrew 等工具使用。如果删除它,您将丢失使用 Homebrew 安装的所有内容,包括 Homebrew 本身,但您可以在之后重新安装它。您还将丢失安装在那里的其他工具。根据您在那里有多少,这可能是一个快速或非常长的过程。

If you don't want to do this, you have to consult the source that provided you with your gcc. Or you could just rmgcc and its related binaries under /usr/local/binand everything under /usr/local/libexec/gcc. This will not harm your OS, but it will probably leave you behind with unnecessary files littering your /usr/local. I strongly advice against doing this unless you know what you're doing.

如果您不想这样做,则必须咨询为您提供 gcc 的来源。或者,您可以只使用rmgcc 及其相关的二进制文件/usr/local/bin以及/usr/local/libexec/gcc. 这不会损害你的操作系统,但它可能会让你留下不必要的文件乱扔你的/usr/local. 我强烈建议不要这样做,除非您知道自己在做什么