Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have gcc 4.6.2 installed (installed from tar source) in my ubuntu server 10.10 64 bit, I have also installed gcc 4.4.5. I want to uninstall gcc 4.6.2 and make my old gcc 4.4.5 default. How can I do this?

share|improve this question

migrated from superuser.com Feb 4 '12 at 21:41

This question came from our site for computer enthusiasts and power users.

3 Answers 3

Don't need to uninstall 4.6.2. If you have installed it from the repositories and also have gcc 4.5 installed, you can do:

sudo update-alternatives --config gcc

which will allow you to choose what is your default compiler. Uninstalling gcc 4.6.2 could impact other packages.

share|improve this answer

First, don't change the default compiler used by your OS super-user. The packaging guys have carefully tested that everything works with 4.6, and if you change that you risk destabilizing your system, and that could end badly.

What you can do is adjust the default compiler for yourself only by simply altering the PATH variable in your shell setup.

So, simply add this:

PATH=/path/to/your/gcc/bin:$PATH

to your ~/.profile or ~/.bash_profile or ~/.bashrc or whatever is most appropriate to you. (Or just add it to all of them to be on the safe side.

share|improve this answer

Not to res a dead thread or anything, but I just wanted to thank ya'll for your responses. Each assisted me in solving an issue while trying to compile the latest version of John the Ripper (1.8.0-jumbo-1).

If anyone else experiences the same error as below, begin by checking your path. Update alternatives if the path already has the appropriate URIs to cc1plus:

gcc-4.6: error trying to execute 'cc1plus' : execvp: No such file or directory

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.