-1

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

4
  • Remove cpp and try again :-) Jun 4, 2012 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, 2012 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). Jun 6, 2012 at 1:24
  • You can't with the version of Ubuntu that you have.
    – Braiam
    Mar 30, 2014 at 15:59

2 Answers 2

0

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

1
  • I have try this, it doesn't work.
    – SSolid
    Jun 5, 2012 at 4:01
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .