I am a newcomer to linux and have had lots of problems in installing java on my newly installed Ubuntu 11.10. I use a statistical programming environment called R and many of the packages there require java (the sun variety, I am told). I tried the following :
sudo add-apt-repository ppa:ferramroberto/java sudo apt-get update sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
(after this, I wanted to continue with (but never got that far) :
sudo apt-get install sun-java6-jdk
After this, a window appeared with the heading, "Configuring jre", or something like that. Below was a long list of legal text about accepting Sun's terms. I did not know how to close this window (no obvious option like pressing return worked). After a long time, when nothing seemed to happen, I finally closed the window. After that, I could not open synaptic.
I got the error message :
dpkg was interrupted. You must manually run 'sudo dpkg --configure -a'
I did this. But it does not help. I have java as a "broken" program. When I try to remove the program from synaptic, I get a message that I must reinstall it again.I do not know what I should do.
I want to install jdk6. And also remove the open jdk which is still persistently present in my system.
I tried the clean and purge command shown below. Next, I tried to remove the sun-java6-jre from synaptic. I get the following message :E: sun-java6-jre: Package is in a very bad inconsistent state - you should reinstall it before attempting a removal. When I tried to follow the procedure suggested in the related question (from the link suggested below), I get the following message on trying to install again :Could not mark all packages for installation or upgrade.The following packages have unresolvable dependancies. Make sure that all required repositories are added and enabled in the preferences. sun-java6-bin : Depends: sun-java6-jre but it is not going to be installed
Eliah, Thanks for your reply. I like your principled stand and your spirited defence of it in the link that you have provided. I will come back to this later (and about the multiple options and opinions on installing jdk7). I may also have to take the issue of open jdk vs oracle jdk in the R forums. But I must first solve the problem of removing the broken jre program on my installation, which remains unresolved. I show here the results of the command that you suggested :
ravi@raviM1330:~$ sudo apt-get purge sun-java6-jre sun-java6-plugin sun-java6-fonts [sudo] password for ravi: Reading package lists... Done Building dependency tree Reading state information... Done Package sun-java6-fonts is not installed, so not removed Package sun-java6-plugin is not installed, so not removed The following package was automatically installed and is no longer required: java-wrappers Use 'apt-get autoremove' to remove them. The following packages will be REMOVED: sun-java6-jre* 0 upgraded, 0 newly installed, 1 to remove and 26 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? y dpkg: error processing sun-java6-jre (--purge): Package is in a very bad inconsistent state - you should reinstall it before attempting a removal. Errors were encountered while processing: sun-java6-jre E: Sub-process /usr/bin/dpkg returned an error code (1) ravi@raviM1330:~$
I am now happy to report that my problem with the installation of sun jdk6 is now resolved. Actually, I did not do much myself. I just ran the update manager and this solved the problem of the broken installation. New programs were loaded. Halfway through this update, the window with the legal term screen appeared again. This time, I could tick in one of the boxes stating that I accept the terms (there was no such box previously, or at least, I did not locate it). After that, I went back to synaptic, chose the remaining items from the PPA associated with sun jdk6 and installed them.
The only remaining steps were to remove the open jdk (from the ubuntu software centre) and then to configure Java as required by R (the statistical programming environment for which I required Java). I did this by running the command : R CMD javareconf. This set up the java configuration in /etc/R.