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 Ubuntu there is g++ --version -

g++ (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I want to have same g++ --version on another Linux machine which has -

g++ (GCC) 4.1.2 20070626 (Red Hat 4.1.2-14)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

How can I alter my g++ version to be the same as the above?

share|improve this question
    
sudo apt-get install g++-4.4 –  green7 Nov 2 '12 at 8:55
    
@green7 it will overwrite the last version ? –  URL87 Nov 2 '12 at 9:02

1 Answer 1

up vote 0 down vote accepted

Download the g++-4.1 version from here. g++-4.1 is not available in the recent Ubuntu repositories. So you need to download the package from the link provided.

Install/compile the download package alongside with the current version of g++.

Then use update-alternatives to switch version

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.3 10

Change the default version by choosing the appropriate version:

sudo update-alternatives --config g++
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.