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.

It may seems simlar to this question: Old version of gcc for new Ubuntu

but I can't solve it with the method provided in that thread

I get some error like

gcc-4.1 : Depends: cpp-4.1 (= 4.1.2-27ubuntu1) but it is not going to be installed

can someone tell me how to do it?

thanks

share|improve this question
    
Remove cpp and try again :-) –  Vitalie Ciubotaru Jun 4 '12 at 8:21
    
to Vitalie Ciubotaru , if I try to remove cpp ( version 4.6) , then I will need to remove a lot of softwares, this doesn't seem good –  SSolid Jun 5 '12 at 4:01
    
That is true. If you want to downgrade gcc, a bunch of other packages will need to be downgraded, too. In general, there's no good mechanism to downgrade packages. The only way is to remove the new ones and to install them again indicating the desired versions (as advised in the answer below askubuntu.com/a/146264/64668). –  Vitalie Ciubotaru Jun 6 '12 at 1:24
    
You can't with the version of Ubuntu that you have. –  Braiam Mar 30 at 15:59

2 Answers 2

to downgrade a package the command we have is

sudo apt-get install <pkg_name=its version>

so for your case

sudo apt-get install gcc=4.1.1

after installing older version of gcc, use update-alternatives --config to switch to it

sudo update-alternatives --config gcc

then select the number corresponding to the version you want to switch to

share|improve this answer
    
I have try this, it doesn't work. –  SSolid Jun 5 '12 at 4:01

I always use Synaptic Package Manager to fix such issues. Using it you can forcefully install other version of packages.

  • Fist install synaptic package manager if you don't have already installed:

    $ sudo apt-get install synaptic
    
  • Then open synaptic package manager -> click Custom Filters down-left -> click Broken top-left, it will list all broken packages try to fix all broken packages. Also if any residual packages are there on more option you will get as residual packages. -Search for packages you want to downgrade/upgrade, highlight it by simply clicking on it do not mark(tick), chose Package from the menu -> Force Version and chose some other versions from the list. Then click Apply to install it.
  • Try to install again using command line.

Hope it works for you.

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.