简体   繁体   中英

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.

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

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. 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. However, I don't know if I can or how I would rectify the GCC situation before doing so.

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.

Is there a way to get rid of the experimental GCC 4.8 so it doesn't come back in the future?

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

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? I seriously recommend you go with Homebrew. That should get the latest GCC 4.8 onto OR OFF OF your box with ease. 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. It's not coming back. Clearly you never removed it if typing gcc brings up gcc. It's probably in /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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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