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 4.5.2 installed from the Ubuntu official repositories. I would like to install 4.6 as well to try out the C++0x features it brings.

How can I do this without breaking my system? I'm fine with the newer being default, but also want to keep the older version.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

If you know your way around the command line, you should be able to compile from source and set the configuration to install in /opt.

Something along the lines of ./configure --prefix=/opt.

share|improve this answer
add comment

I don't think that there is any way to do this via dpkg or the apt package management system. Thus, your option of resort is to compile from source, making this less of an Ubuntu question, and more of a gcc question. I am sure that

  1. Compiling gcc from source is a fairly involved process, especially with special requirements such as yours.
  2. There are plenty of tutorials on the matter.

A good lead is to research setting up a "cross compiler", which in your case would use the same hardware architecture as your normal gcc.

share|improve this answer
add comment

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.