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.

I want to downgrade from OpenJDK Update 25 to OpenJDK Update 21.

If I look, for example, at security.ubuntu.com or at mirror.pnl.gov, I can see that .deb files for Update 21 are still there, however, when I use apt-cache show or aptitude, I only see Update 25 and Update 3, and if I try:

aptitude -s install openjdk-7-jre-headless=7u21-2.3.9-0ubuntu0.12.04.1

I get:

Unable to find a version "7u21-2.3.9-0ubuntu0.12.04.1" for the package "openjdk-7-jre-headless"

Is there any way I can downgrade using apt tools? If the only option is dpkg, will this package be "visible" for aptitude, for example, when resolving dependencies?

share|improve this question
1  
First check your rdepends. You'll have to blow those out to get the downgrade to work in a stable manner. Then remove the package. Then install the version you want. Then pin it. Then apt-get update. Then re-install known compatible versions that you removed because of rdepends. It's more steps than I want to make a copy paste-able answer for...but those are the steps. –  hbdgaf Jul 18 '13 at 15:47

1 Answer 1

up vote 1 down vote accepted

I tried simplier way than in the comment to the question, and it seems working for me.

I downloaded .deb file for openjdk-7-jre-headless:

wget http://mirror.pnl.gov/ubuntu/pool/universe/o/openjdk-7/openjdk-7-jre-headless_7u21-2.3.9-0ubuntu0.12.04.1_i386.deb

Then I tried:

dpkg -i openjdk-7-jre-headless_7u21-2.3.9-0ubuntu0.12.04.1_i386.deb

And got a message telling me about incompatible version of openjdk-7-jre-lib (forgot to copy the message itself, sorry)

I downloaded .deb file for openjdk-7-jre-lib:

wget http://mirror.pnl.gov/ubuntu/pool/universe/o/openjdk-7/openjdk-7-jre-lib_7u21-2.3.9-0ubuntu0.12.04.1_all.deb

Then I tried:

dpkg -i openjdk-7-jre-headless_7u21-2.3.9-0ubuntu0.12.04.1_i386.deb openjdk-7-jre-lib_7u21-2.3.9-0ubuntu0.12.04.1_all.deb

And it seemed to downgrade properly.

share|improve this answer
    
Thanks, this saved my day. –  Gerald Schneider May 30 at 7:29
    
Follow up: You can prevent future upgrades of the downgraded packages (there is a reason you did the downgrade) by running this command: sudo echo "<packagename> hold" | sudo dpkg --set-selections. –  Gerald Schneider May 30 at 7:32
    
to re-enable upgrades: sudo echo "<packagename> install" | sudo dpkg --set-selections –  Gerald Schneider May 30 at 8:30

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.