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 was writing a program on my laptop to run on my server in Java. However, my laptop has Java 7 running, my server Java 6. This messed up. I tried to upgrade my server by installing openjdk-7-jre and openjdk-7-jdk packages. This didn't work.

So I followed a guide helping me removing all java associated files and then re-install the needed packages. Something went wrong here. I installed all the available java 7 packages and now I cannot use the java command anymore. I probably screwed up, does anyone knows how to fix it? I tested it with both the 7 and 6 install, nothing works anymore.

share|improve this question
1  
Are you using Ubuntu? Which version? –  Zignd Aug 26 '12 at 18:04
1  
I think you should check if this packages are broken. –  Zignd Aug 26 '12 at 18:05
    
I'm using ubuntu server 11.10, how to fix broken packages? –  Brent Roose Aug 26 '12 at 18:46

4 Answers 4

Ubuntu fix broken package http://www.iasptk.com/ubuntu-fix-broken-package-best-solution

share|improve this answer
1  
Please include details from the link as if it goes down, your answer may not be useful to future visitors. Also, this answer applies to a GUI system but the OP only has access to a commend-line. –  hexafraction Aug 26 '12 at 19:33

I'm using ubuntu server 11.10, how to fix broken packages? (from the comments)

On the command line type:

sudo apt-get -f install

And you can also use this:

sudo dpkg --configure -a

And as written here:

If the problem of a broken package still exist the solution is to edit the dpkg status file manually.

$ sudo nano /var/lib/dpkg/status (you can also use vi instead of nano)

Locate the corrupt package, and remove the whole block of information about it and save the file.

It will fix the problem of broken packages.

share|improve this answer
    
Ok, but I'm on ubuntu server, no GUI? –  Brent Roose Aug 26 '12 at 19:00
    
@BrentRoose I broke a package on my Ubuntu here voluntarily to discover how to repair. –  Zignd Aug 26 '12 at 19:05
    
And the solution is on my answer. –  Zignd Aug 26 '12 at 19:10

After trying:

sudo dpkg --configure -a

and

sudo apt-get install -f

the problem of a broken package still exist.

The solution is to edit the dpkg status file manually:

$ sudo nano /var/lib/dpkg/status

Locate the corrupt package, and remove the whole block of information about it and save the file.

share|improve this answer

Here explains how to install Oracle Java 7 packages on 12.04.
The step #6 might solve the problem.

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.