Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 18365  / 1 Year ago, mon, january 23, 2023, 10:27:18

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?


More From » apt

 Answers
5

I would remove the version from your "java-runtime-headless" dependency.




Virtual packages suffer from some troubling limitations, the most
significant of which being the absence of a version number.




http://debian-handbook.info/browse/stable/sect.package-meta-information.html




If you want to specify which of a set of real packages should be the
default to satisfy a particular dependency on a virtual package, you
should list the real package as an alternative before the virtual one.




http://sdn.vlsm.org/share/Debian-Doc/debian-policy/ch-relationships.html


[#30194] Wednesday, January 25, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
edseager

Total Points: 185
Total Questions: 105
Total Answers: 102

Location: Angola
Member since Wed, Apr 13, 2022
2 Years ago
;