Uninstalling sun-java6-* does not remove the binfmts-entry for "jar"

Bug #328174 reported by Daniel Höfer on 2009-02-11
32
This bug affects 7 people
Affects Status Importance Assigned to Milestone
sun-java6 (Ubuntu)
Undecided
Unassigned

Bug Description

(using Ubuntu 8.10 32bit and the packages sun-java6-bin and sun-java6-jre)

Uninstalling sun-java6 (6-10-0ubuntu2) and then installing openjdk-6 (6b12-0ubuntu6.1) leads to some "warnings" regarding binfmts:

(from /var/log/apt/term.log -- sorry, its partly german, but that should not matter)
-------------------
Richte openjdk-6-jre-headless ein (6b12-0ubuntu6.1) ...
Installiere neue Version der Konfigurationsdatei /etc/java-6-openjdk/security/java.security ...
update-binfmts: warning: current package is openjdk-6, but binary format
already installed by sun-java6
-------------------

The reason for this error message: even after a complete uninstall of sun-java6 I get:

-------------------
$ update-binfmts --display

jar (enabled):
     package = sun-java6
        type = magic
      offset = 0
       magic = PK\x03\x04
        mask =
 interpreter = /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/jexec
    detector =
-------------------

To get rid of the error message from update-binfmts I had to manually remove that entry:

-------------------
$ update-binfmts --package sun-java6 --remove jar /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/jexec

update-binfmts: warning: no executable
/usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/jexec found, but continuing anyway as
you request
-------------------

After doing the above and installing openjdk-6 the binftms-entry for "jar" is correct:

-------------------
$ update-binfmts --display

jar (enabled):
     package = openjdk-6
        type = magic
      offset = 0
       magic = PK\x03\x04
        mask =
 interpreter = /usr/bin/jexec
    detector =
-------------------

But _without_ manual intervention (i.e. NOT running "update-binfmts --package sun-java6 --remove jar /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/jexec") uninstalling sun-java6 and installing openjdk-6 leads to a wrong binfmts-entry:

-------------------
$ update-binfmts --display

jar (enabled):
     package = sun-java6
        type = magic
      offset = 0
       magic = PK\x03\x04
        mask =
 interpreter = /usr/lib/jvm/java-6-sun-1.6.0.10/jre/lib/jexec
    detector =
-------------------

I think it is expected that uninstalling sun-java6 does remove its binfmts-entry for "jar" automatically, so please include this behavior in the package.
(oh, and uninstalling openjdk-6 doesn't remove its binfmts-entry either so that must have been overlooked as well..)

Nick Rhodes (ngrhodes) wrote :

I can confirm this behavior in Januty for both sun and openjdk
I have a virtual machine with Hardy installed and it does not suffer from this bug.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sun-java6 (Ubuntu):
status: New → Confirmed
useResa (rdrijsen) wrote :

I have just upgraded from Ubuntu 11.10 to Ubuntu 12.04.
One of the things I did after the upgrade is change over to Java 7 by using the PPA as described on the WEB UPD8 page (see http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html).

During the installation I noticed the following error message:
update-binfmts: warning: current package is oracle-java7, but binary format already installed by sun-java6

As the OP I had a very similar result when running update-binfmts --display (partial result given below)
jar (enabled):
     package = sun-java6
        type = magic
      offset = 0
       magic = PK\x03\x04
        mask =
 interpreter = /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/jexec
    detector =

I used the suggestion as opted by the OP using the following command
$ sudo update-binfmts --package sun-java6 --remove jar /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/jexec
update-binfmts: warning: no executable /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/jexec found, but continuing anyway as you request

Next I reinstalled the Java 7 installer
$ sudo aptitude reinstall oracle-java7-installer

Now the warning is no longer present and the correct jexec is displayed (again partial result of upate-binfmts --display):
jar (enabled):
     package = oracle-java7
        type = magic
      offset = 0
       magic = PK\x03\x04
        mask =
 interpreter = /usr/lib/jvm/java-7-oracle/jre/lib/jexec
    detector =

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers