Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In my office we have gcc-4.5.1, with that version my c++ project works fine. If I compile the same project at home with Ubuntu 12.04 with gcc-4.6, I have lot of errors and I couldn't compile at all. I spent some time on the Internet to build the gcc from sources but the installation had lot of issues and the build is broken.

I am looking for a way to downgrade my gcc version to 4.5.1.

If someone can also give a step by step way of compiling gcc from sources would be appreciated.

share|improve this question

Try installing the gcc-4.5-base package:

$ sudo apt-get install gcc-4.5-base

You might need to install a specific version of that package. Check the package change log.

To install the last 4.5.1 update try:

$ sudo apt-get install gcc-4.5-base=4.5.1-12

(note that 4.5.1-12 was marked as experimental in the change log. This is just an example!)

For more info on installing old versions of packages with apt take a look at:

share|improve this answer

Your Answer


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.