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.

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
add comment

1 Answer

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:

http://blog.andrewbeacock.com/2007/03/how-to-install-specific-version-of.html

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.