I'm in the process of creating a .deb
package of our Java-based application (see this superuser-question). I'm now using following dependency information:
Depends: java-runtime-headless (>= 1.6)
Recommends: openjdk-7-jre-headless, ...
Now I'm trying to install it:
$ sudo dpkg -i MYAPP.deb
Selecting previously unselected package MYAPP.
(Reading database ... 140874 files and directories currently installed.)
Unpacking MYAPP (from MYAPP.deb) ...
dpkg: dependency problems prevent configuration of MYAPP:
MYAPP depends on java-runtime-headless (>= 1.6); however:
Package java-runtime-headless is not installed.
dpkg: error processing MYAPP (--install):
dependency problems - leaving unconfigured
Processing triggers for desktop-file-utils ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf.index...
Processing triggers for gnome-menus ...
Errors were encountered while processing:
MYAPP
$
OK, I'm trying to install the dependency:
$ sudo apt-get install java-runtime-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package java-runtime-headless is a virtual package provided by:
openjdk-7-jre-headless 7u25-2.3.10-1ubuntu0.12.04.2
openjdk-6-jre-headless 6b27-1.12.6-1ubuntu0.12.04.2
gcj-jre-headless 4:4.6.3-1ubuntu5
gcj-4.6-jre-headless 4.6.3-1ubuntu2
default-jre-headless 1:1.6-43ubuntu2
You should explicitly select one to install.
E: Package 'java-runtime-headless' has no installation candidate
OK, I chose one of these packages:
$ sudo apt-get install openjdk-7-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
openjdk-7-jre-headless : Depends: openjdk-7-jre-lib (= 7u25-2.3.10-1ubuntu0.12.04.2) but it is not going to be installed
Depends: ca-certificates-java but it is not going to be installed
Depends: tzdata-java (>= 2012e-0ubuntu0.12.04.1) but it is not going to be installed
Depends: java-common (>= 0.28) but it is not going to be installed
Depends: libnss3-1d (>= 3.12.9+ckbi-1.82-0ubuntu4) but it is not going to be installed
Recommends: icedtea-7-jre-jamvm (= 7u25-2.3.10-1ubuntu0.12.04.2) but it is not going to be installed
MYAPP : Depends: java-runtime-headless (>= 1.6)
Recommends: mercurial but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Now it only suggests me to remove my application:
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
MYAPP
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 41.0 MB disk space will be freed.
Do you want to continue [Y/n]? n
Abort.
$
It looks like I first need to install the dependency (openjdk-7-jre-headless
) and then my application. How a normal user should understand that? Or is there a better way to install MYAPP.deb
?