简体   繁体   English

从Mac OS X Mountain Lion降级或删除GCC 4.8

[英]Downgrade or remove GCC 4.8 from Mac OS X Mountain Lion

I am in the process of trying to essentially start from scratch with getting homebrew, GCC and RVM 1.9.3 on to my mac OS x 10.8.2 after determining that my problems with RVM were "related to a messy environment which can not be fixed automatically without what we plan for RVM2" in a thread that began here on SO and ended as a github for ticket RVM. 在确定我的RVM问题“与无法解决的混乱环境有关之后,我正在尝试从头开始,从开始自制软件,GCC和RVM 1.9.3到我的mac OS x 10.8.2。自动运行,而无需我们为RVM2进行计划”,该线程始于SO上 ,以票务 RVM的github结尾。

I had XCode 4.6 with Command Line Tools installed as was recommended here but at this point have completely deleted XCode (by trashing it- due to the version sudo /Developer/Library/uninstall-devtools --mode=all did not work), I uninstalled homebrew by running 我按照这里的建议安装了XCode 4.6,并安装了命令行工具,但此时已完全删除了XCode(通过删除它-由于版本sudo /Developer/Library/uninstall-devtools --mode=all不起作用),我通过运行卸载自制软件

cd `brew --prefix`
brew install libtool
rm -rf Cellar
rm `git ls-files`
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
rm -rf .git
rm -rf ~/Library/Caches/Homebrew

and imploded my rvm. 并崩溃了我的rvm。 However, I am not sure how to go about 'refreshing' my GCC situation. 但是,我不确定如何“刷新”我的海湾合作委员会情况。 Which is as follows: 如下:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-apple-darwin12.2.0
Configured with: ../gcc-4.8-20130113/configure --enable-languages=c++,fortran
Thread model: posix
gcc version 4.8.0 20130113 (experimental) (GCC) 

I have Time Machine backups from various stages of my undoing and made a bootable USB of Mountain Lion but was hoping to try reinstalling a fresh copy of Xcode or running the GCC-10.7 program installer before using either of those methods. 我在撤消的各个阶段都备份了Time Machine,并制作了可启动的Mountain Lion USB,但希望在使用这两种方法之前,尝试重新安装Xcode的新副本或运行GCC-10.7程序安装程序。 However, I don't know if I can or how I would rectify the GCC situation before doing so. 但是,在执行此操作之前,我不知道是否可以或如何纠正GCC的情况。

From reading Change to GCC 4.7.. , it seems that there might be a way of pointing/directing my system to a different version of GCC, but I don't know how to do that without MacPorts or homebrew. 从阅读Change to GCC 4.7。 ,似乎可能存在一种将系统指向/定向到其他版本的GCC的方法,但是我不知道如果没有MacPorts或自制软件,该怎么做。

Is there a way to get rid of the experimental GCC 4.8 so it doesn't come back in the future? 有没有办法摆脱实验性的GCC 4.8,这样将来就不会回来了?

I have run a VM of my system with a copy of /usr/local/ from before I had ever installed XCode CLT or any of these other libraries, but my $ gcc -v still came back with gcc version 4.8.0 在安装XCode CLT或任何其他这些库之前,我已经使用/ usr / local /的副本运行了系统的VM,但是我的$ gcc -v仍返回gcc version 4.8.0

Sorry if I omitted and/or added necessary/unnecessary information and thank you in advance for any help. 抱歉,我省略和/或添加了必要/不必要的信息,在此先感谢您的帮助。

This is a confusing dump of information. 这是一个令人困惑的信息转储。 You don't want to use MacPorts or Homebrew? 您不想使用MacPorts或Homebrew? I seriously recommend you go with Homebrew. 我强烈建议您选择自制软件。 That should get the latest GCC 4.8 onto OR OFF OF your box with ease. 这样就可以轻松地将最新版本的GCC 4.8放到您的包装盒中。 If you can't figure out where your current gcc 4.8 is, try typing "which gcc" and that will tell you where it's located. 如果您无法确定当前的gcc 4.8在哪里,请尝试键入“哪个gcc”,它将告诉您它的位置。 It's not coming back. 它不会回来了。 Clearly you never removed it if typing gcc brings up gcc. 显然,如果键入gcc会弹出gcc,则您永远不会删除它。 It's probably in /usr/local/opt . 它可能在/usr/local/opt

If you insist on wiping out ALL the homebrew stuff manually, you COULD just zap /usr/local/opt to get rid of the symlinks, and /usr/local/Cellar to get rid of the real stuff, but I don't recommend it. 如果您坚持要手动清除所有自制软件,则可以直接使用/usr/local/opt摆脱符号链接,而/usr/local/Cellar摆脱真正的东西,但是我不建议它。 Why? 为什么? Zapping directories by hand could cause you to lose data especially if you're prone to making mistakes. 手动更改目录可能会导致您丢失数据,尤其是在您容易出错的情况下。 Use MacPorts or Homebrew to REMOVE whatever you used it to install. 使用MacPorts或Homebrew删除您用于安装的任何文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM