LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Java installing issue using apt (https://www.linuxquestions.org/questions/linux-newbie-8/java-installing-issue-using-apt-457359/)

fault 06-22-2006 04:35 PM

Java installing issue using apt
 
Hello there.
I'm using Ubuntu dapper. Recently I tried to install Java using the apt programm. But it gives me these lines which i dont know what to do on:
Code:

fault@fault:~$ sudo apt-get install sun-java5-jdk
Reading package lists... Done
Building dependency tree... Done
You might want to run ‘apt-get -f install’ to correct these:
The following packages have unmet dependencies.
  sun-java5-demo: Depends: sun-java5-jre (= 1.5.0-06-1) but it is not going to be installed
  sun-java5-jdk: Depends: sun-java5-jre (= 1.5.0-06-1) but it is not going to be installed
E: Unmet dependencies. Try ‘apt-get -f install’ with no packages (or specify a solution).

Ok, then I do:
Code:

fault@fault:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree... Done
Correcting dependencies...Done
The following extra packages will be installed:
  sun-java5-bin sun-java5-jdk sun-java5-jre
Suggested packages:
  sun-java5-doc sun-java5-source sun-java5-plugin ia32-sun-java5-plugin sun-java5-fonts
The following NEW packages will be installed
  sun-java5-bin sun-java5-jdk sun-java5-jre
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
Need to get 0B/34.5MB of archives.
After unpacking 95.2MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Preconfiguring packages ...
(Reading database ... 109362 files and directories currently installed.)
Unpacking sun-java5-bin (from .../sun-java5-bin_1.5.0-06-1_i386.deb) ...
sun-dlj-v1-1 license could not be presented
dpkg: error processing /var/cache/apt/archives/sun-java5-bin_1.5.0-06-1_i386.deb (--unpack):
 subprocess pre-installation script returned error exit status 2
Unpacking sun-java5-jre (from .../sun-java5-jre_1.5.0-06-1_all.deb) ...
sun-dlj-v1-1 license could not be presented
dpkg: error processing /var/cache/apt/archives/sun-java5-jre_1.5.0-06-1_all.deb (--unpack):
 subprocess pre-installation script returned error exit status 2
Unpacking sun-java5-jdk (from .../sun-java5-jdk_1.5.0-06-1_i386.deb) ...
sun-dlj-v1-1 license could not be presented
dpkg: error processing /var/cache/apt/archives/sun-java5-jdk_1.5.0-06-1_i386.deb (--unpack):
 subprocess pre-installation script returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/sun-java5-bin_1.5.0-06-1_i386.deb
 /var/cache/apt/archives/sun-java5-jre_1.5.0-06-1_all.deb
 /var/cache/apt/archives/sun-java5-jdk_1.5.0-06-1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

What does it say? What do I have to do?
Thanks in advance. -fault

rickh 06-22-2006 06:28 PM

I have had nothing but trouble trying to install java from the Debian repos. I've gone back to the old fashioned way. It works better. It looks complicated, but it's not.

fault 06-23-2006 04:08 AM

this brings same errors... :(
somehow every package i try to install using apt seems to depend on these java packages, even when i try to remove anything allready installed. What is this? Is apt somehow messed up?

Dummy-in-Linux 06-23-2006 04:37 AM

Tips....

Not use apt it doesn't work and probably will never work.

So go to the Sun Java website and download the jre-1_5_0_07-linux-i586.bin file.

https://sdlc1b.sun.com/ECom/EComActi...DFBD8917FC8A6D

Save this in the root folder and login as root run then do this;

chmod a+x jre-1_5_0_07-linux-i586.bin
./jre-1_5_0_07-linux-i586.bin
ln -s /usr/java/jre1.5.0_07/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jre1.5.0_07/bin/java 1507
java -version

And Java is installed.... (the location for your Mozilla plugin fodler can be different)

nx5000 06-23-2006 05:45 AM

Quote:

Originally Posted by Dummy-in-Linux

Not use apt it doesn't work and probably will never work.

Are you talking about apt in general or apt for this package? And then can you explain a bit further? Thanks

To the OP:
You are doing the correct method (rickh's one also work but there is an easier one now).
What release of debian you use? Put it in your profile, please, you will get proper support.

If its what I think, its trivial to fix. But I need to know which release you use.

fault 06-23-2006 06:22 AM

thx dummy-in-linux, but it still doesnt work interly:
Code:

root@fault:/usr/lib/mozilla# /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jre1.5.0_07/bin/java 1507
bash: /usr/sbin/alternatives: No such file or directory

java -version gives me:
Code:

root@fault:/usr/lib/mozilla# java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.0 (Ubuntu 4.1.0-1ubuntu8)

Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@nx5000
I'm using Ubuntu Dapper:
Code:

root@fault:/usr/lib/mozilla# cat /proc/version
Linux version 2.6.15-25-386 (buildd@terranova) (gcc version 4.0.3 (Ubuntu 4.0.3-1ubuntu5)) #1 PREEMPT Wed Jun 14 11:25:49 UTC 2006


nx5000 06-23-2006 06:29 AM

from root:
Code:

xauth -merge ~fault/.Xauthority
and then redo apt-get

I suggest you do this, otherwise you will have the problem again
Code:

dpkg-reconfigure debconf
choose dialog

This is fixed in Debian sid, I don't know for Ubuntu

But you already installed the .bin so I don't know what will happen..

sun-dlj-v1-1 license could not be presented was the error

nx5000 06-23-2006 06:33 AM

/usr/sbin/update-alternatives --install /usr/bin/java java /usr/java/jre1.5.0_07/bin/java 1507

fault 06-23-2006 09:06 AM

I tried to install java using synaptics. It displayed the licence and I was able to accept it. Installing through synaptics worked fine. I'm happy now, since everyhting is working fine. Thanks for support.

nx5000 06-23-2006 09:57 AM

Still you should do this:
Quote:

Originally Posted by nx5000
from root:

Code:

dpkg-reconfigure debconf
choose dialog


Because there are a few packages that will call debconf

On my release, it is corrected:
in case root is not allowed to open a window, it falls back to text mode.


All times are GMT -5. The time now is 07:26 PM.