Uninstalling gcc completely in Mac OS X Yosemite?

情到浓时终转凉″ 提交于 2019-12-12 04:25:54

问题


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

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 .


回答1:


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

/usr/local is 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.

If you don't want to do this, you have to consult the source that provided you with your gcc. Or you could just rm gcc and its related binaries under /usr/local/bin and 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.



来源:https://stackoverflow.com/questions/28475708/uninstalling-gcc-completely-in-mac-os-x-yosemite

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!