Score:0

update-alternatives: error: alternative javac can't be master: it is a slave of java

fr flag

I've a heterogeneous Java installations, where I've installed some versions manually and others via the package manager. I wanted to have javac to change accordingly with java, so I had each java version with its own javac slave. I can't recall off the top of my head of whether I've removed javac own separate alternatives while doing so, but surly I don't have one as of now.
Now whenever I try to upgrade or even install another package, I got this error message appended at the end. I'm thinking of disabling the post-installation script, but I don't how to selectively disable it for java.


Solutions that I'm not for:

  • Reverting to the previous behavior of having separate java and javac alternatives
  • Total dependence on some other version manager (I've got this solution recommend in a ruby answer).
 $ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libodbc1
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
4 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
Setting up openjdk-8-jdk-headless:amd64 (8u362-ga-0ubuntu1~20.04.1) ...
update-alternatives: error: alternative javac can't be master: it is a slave of java
dpkg: error processing package openjdk-8-jdk-headless:amd64 (--configure):
 installed openjdk-8-jdk-headless:amd64 package post-installation script subprocess returned error exit status 2
Setting up openjdk-17-jdk-headless:amd64 (17.0.6+10-0ubuntu1~20.04.1) ...
update-alternatives: error: alternative javac can't be master: it is a slave of java
dpkg: error processing package openjdk-17-jdk-headless:amd64 (--configure):
 installed openjdk-17-jdk-headless:amd64 package post-installation script subprocess returned error exit status 2
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of openjdk-8-jdk:amd64:
 openjdk-8-jdk:amd64 depends on openjdk-8-jdk-headless (= 8u362-ga-0ubuntu1~20.04.1); however:
  Package openjdk-8-jdk-headless:amd64 is not configured yet.

dpkg: error processing package openjdk-8-jdk:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-17-jdk:amd64:
 openjdk-17-jdk:amd64 depends on openjdk-17-jdk-headless (= 17.0.6+10-0ubuntu1~20.04.1); however:
  Package openjdk-17-jdk-headless:amd64 is not configured yet.

dpkg: error processing package openjdk-17-jdk:amd64 (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 openjdk-8-jdk-headless:amd64
 openjdk-17-jdk-headless:amd64
 openjdk-8-jdk:amd64
 openjdk-17-jdk:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.