package openjdk-8-jre-headless 8u181-b13-1ubuntu0.18.04.1 failed to install/upgrade: trying to overwrite shared '/etc/java-8-openjdk/security/java.security', which is different from other instances of package openjdk-8-jre-headless:amd64

Bug #1806265 reported by George Nace
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
openjdk-8 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Package crash on automated install.

ProblemType: Package
DistroRelease: Ubuntu 18.04
Package: openjdk-8-jre-headless 8u181-b13-1ubuntu0.18.04.1
ProcVersionSignature: Ubuntu 4.15.0-42.45-generic 4.15.18
Uname: Linux 4.15.0-42-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.9-0ubuntu7.5
AptOrdering:
 openjdk-8-jdk:amd64: Install
 openjdk-8-jdk-headless:amd64: Install
 openjdk-8-jre:amd64: Install
 openjdk-8-jre-headless:amd64: Install
 NULL: ConfigurePending
Architecture: amd64
Date: Wed Nov 28 06:37:25 2018
DuplicateSignature:
 package:openjdk-8-jre-headless:8u181-b13-1ubuntu0.18.04.1
 Unpacking openjdk-8-jre-headless:amd64 (8u191-b12-0ubuntu0.18.04.1) over (8u181-b13-1ubuntu0.18.04.1) ...
 dpkg: error processing archive /var/cache/apt/archives/openjdk-8-jre-headless_8u191-b12-0ubuntu0.18.04.1_amd64.deb (--unpack):
  trying to overwrite shared '/etc/java-8-openjdk/security/java.security', which is different from other instances of package openjdk-8-jre-headless:amd64
ErrorMessage: trying to overwrite shared '/etc/java-8-openjdk/security/java.security', which is different from other instances of package openjdk-8-jre-headless:amd64
Python3Details: /usr/bin/python3.6, Python 3.6.7, python3-minimal, 3.6.7-1~18.04
PythonDetails: /usr/bin/python2.7, Python 2.7.15rc1, python-minimal, 2.7.15~rc1-1
RelatedPackageVersions:
 dpkg 1.19.0.5ubuntu2.1
 apt 1.6.6
SourcePackage: openjdk-8
Title: package openjdk-8-jre-headless 8u181-b13-1ubuntu0.18.04.1 failed to install/upgrade: trying to overwrite shared '/etc/java-8-openjdk/security/java.security', which is different from other instances of package openjdk-8-jre-headless:amd64
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
George Nace (gnace) wrote :
tags: removed: need-duplicate-check
Revision history for this message
George Nace (gnace) wrote :

I suspect this bug may be related to an install of Oracle's Java package for Ubuntu which I installed using Oracle's deb package. This didn't cause problems for months until I suddenly got the error while running regular packaged updates using the normal user interface and standard Ubuntu tools. I can no longer use apt-get, synaptic or any other deb package installer and I'm hesitant to try to fix things manually by removing files. This latest occurrence was running "sudo apt-get install -f"

Here is the output copied from my terminal session:
=========
gnace@gn-limbo:~$ sudo apt-get install -f
[sudo] password for gnace:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  openjdk-8-jre-headless
Suggested packages:
  fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei
  fonts-wqy-zenhei
The following packages will be upgraded:
  openjdk-8-jre-headless
1 upgraded, 0 newly installed, 0 to remove and 425 not upgraded.
3 not fully installed or removed.
Need to get 0 B/27.3 MB of archives.
After this operation, 35.8 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 531072 files and directories currently installed.)
Preparing to unpack .../openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.04.1_amd64.deb ...
Unpacking openjdk-8-jre-headless:amd64 (8u191-b12-2ubuntu0.18.04.1) over (8u181-b13-1ubuntu0.18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.04.1_amd64.deb (--unpack):
 trying to overwrite shared '/etc/java-8-openjdk/net.properties', which is different from other instances of package openjdk-8-jre-headless:amd64
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
gnace@gn-limbo:~$
==========

Is there some way to fix this using dpkg? The gui installers pop-ups all say that my system has broken dependencies, and suggest using "sudo apt-get install -f". Unfortunately I'm not fluent enough with dpkg to try using that command without some guidance.

Revision history for this message
George Nace (gnace) wrote :

I realize that I'm the only one that has reported this problem. I strongly suspect that somehow the Oracle supplied deb package was the root cause of the problem although it appeared to install correctly and without errors, but I can't be certain so I won't point fingers publicly.

Revision history for this message
George Nace (gnace) wrote :

I would appreciate a suggestion for appropriate commands in deb or dpkg that might help me narrow down the specific cause or fix the broken cache. I'm reluctant to use the file system to remove the
file '/etc/java-8-openjdk/net.properties' manually, but that will probably my next step.

====
...
dpkg: error processing archive /var/cache/apt/archives/openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.04.1_amd64.deb (--unpack):
 trying to overwrite shared '/etc/java-8-openjdk/net.properties', which is different from other instances of package openjdk-8-jre-headless:amd64
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/openjdk-8-jre-headless_8u191-b12-2ubuntu0.18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
===

Revision history for this message
George Nace (gnace) wrote :

Noticed that there is a 'net.properties' in both /etc/java-8-openjdk: and /etc/java-11-openjdk:

====
/etc$ ls java*
java:
security

java-10-oracle:
conf

java-11-openjdk:
accessibility.properties net.properties sound.properties
jvm-amd64.cfg psfontj2d.properties swing.properties
logging.properties psfont.properties.ja
management security

java-8-openjdk:
accessibility.properties jvm-amd64.cfg psfontj2d.properties
calendars.properties jvm-i386.cfg psfont.properties.ja
content-types.properties logging.properties security
flavormap.properties management sound.properties
images net.properties swing.properties

java-8-oracle:
security
===
gnace@gn-limbo:/etc$ ls -l java*/net.properties
-rw-r--r-- 1 root root 4464 Aug 24 2018 java-11-openjdk/net.properties
-rw-r--r-- 1 root root 4464 Jul 23 2018 java-8-openjdk/net.properties
gnace@gn-limbo:/etc$ diff java*/net.properties
6c6
< # on the command line or set programmatically.
---
> # on the command line or set programatically.
14c14
< # Note that the system properties that do explicitly set proxies
---
> # Note that the system properties that do explicitely set proxies
gnace@gn-limbo:/etc$
===

Revision history for this message
George Nace (gnace) wrote :

I need to get this fixed soon - I haven't been able to run system updates or upgrades for several months.

Revision history for this message
George Nace (gnace) wrote :

I am reluctant to change this bug to a question because I think it is a bug that needs to be addressed, but I need some guidance as the next step that I can take to resolve the question. Since I'm not familiar with your bug process and not a member of the team I'm hesitant to assign the bug to myself.

Revision history for this message
George Nace (gnace) wrote :

Problem is definitely related to changes in Oracle licensing for Java, they made a change on April 16, 2019 to their licensing which requires a signature in order to download the DEB file online. There are articles on AskUbuntu regarding this issue related to the webupd8 team PPA:

1 http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html
2 http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

From Synaptic Package Manager broken filter:

E: /var/cache/apt/archives/openjdk-8-jre-headless_8u212-b03-0ubuntu1.18.04.1_amd64.deb: trying to overwrite shared '/etc/java-8-openjdk/calendars.properties', which is different from other instances of package openjdk-8-jre-headless:amd64

Partly fixed but still need to resolve this problem with Oracle.

Revision history for this message
George Nace (gnace) wrote :

I am still struggling with fixing this bug - I have tried manually installing the new Oracle JDK per the instructions in the following answer, but still run into problems with the automated install.

https://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre

After doing this I receive the following errors in Synaptic Package Installer using the fix broken package filter (same result using commandline sudo apt --fix-broken install):
--------
(Reading database ... 531072 files and directories currently installed.)
Preparing to unpack .../openjdk-8-jre-headless_8u212-b03-0ubuntu1.18.04.1_amd64.deb ...
Unpacking openjdk-8-jre-headless:amd64 (8u212-b03-0ubuntu1.18.04.1) over (8u181-b13-1ubuntu0.18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/openjdk-8-jre-headless_8u212-b03-0ubuntu1.18.04.1_amd64.deb (--unpack):
 trying to overwrite shared '/etc/java-8-openjdk/calendars.properties', which is different from other instances of package openjdk-8-jre-headless:amd64
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/openjdk-8-jre-headless_8u212-b03-0ubuntu1.18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
dpkg: dependency problems prevent configuration of openjdk-8-jdk-headless:amd64:
 openjdk-8-jdk-headless:amd64 depends on openjdk-8-jre-headless (= 8u212-b03-0ubuntu1.18.04.1); however:
  Version of openjdk-8-jre-headless:amd64 on system is 8u181-b13-1ubuntu0.18.04.1.
  Version of openjdk-8-jre-headless on system, provided by oracle-java8-installer:all, is <none>.
  Version of openjdk-8-jre-headless on system, provided by oracle-java10-installer:amd64, is <none>.

dpkg: error processing package openjdk-8-jdk-headless:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-8-jdk:amd64:
 openjdk-8-jdk:amd64 depends on openjdk-8-jdk-headless (= 8u212-b03-0ubuntu1.18.04.1); however:
  Package openjdk-8-jdk-headless:amd64 is not configured yet.
  Version of openjdk-8-jdk-headless on system, provided by oracle-java8-installer:all, is <none>.
  Version of openjdk-8-jdk-headless on system, provided by oracle-java10-installer:amd64, is <none>.

dpkg: error processing package openjdk-8-jdk:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-8-jre:amd64:
 openjdk-8-jre:amd64 depends on openjdk-8-jre-headless (= 8u212-b03-0ubuntu1.18.04.1); however:
  Version of openjdk-8-jre-headless:amd64 on system is 8u181-b13-1ubuntu0.18.04.1.
  Version of openjdk-8-jre-headless on system, provided by oracle-java8-installer:all, is <none>.
  Version of openjdk-8-jre-headless on system, provided by oracle-java10-installer:amd64, is <none>.

dpkg: error processing package openjdk-8-jre:amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 openjdk-8-jdk-headless:amd64
 openjdk-8-jdk:amd64
 openjdk-8-jre:amd64

--------

Revision history for this message
George Nace (gnace) wrote :
Download full text (7.3 KiB)

I was finally able to resolve this problem by unchecking/removing the entries for java in the webupd8team ppa, after manually installing the Oracle java-8-sdk using the procedures found in the following answer:

https://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre

After editing the repository using Synaptic Package Manager to remove all of the webupd8team java entries I used Software Updater to successfully update the system.

Here is the terminal output from before and after the successful update:
----------
gnace@gn-limbo:~/Downloads$ java -version
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
gnace@gn-limbo:~/Downloads$ !!
java -version
java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
gnace@gn-limbo:~/Downloads$ sudo apt --fix-broken install
[sudo] password for gnace:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  openjdk-8-jre-headless
Suggested packages:
  fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei
  fonts-wqy-zenhei
The following packages will be upgraded:
  openjdk-8-jre-headless
1 upgraded, 0 newly installed, 0 to remove and 836 not upgraded.
3 not fully installed or removed.
Need to get 0 B/27.3 MB of archives.
After this operation, 78.8 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 531072 files and directories currently installed.)
Preparing to unpack .../openjdk-8-jre-headless_8u212-b03-0ubuntu1.18.04.1_amd64.deb ...
Unpacking openjdk-8-jre-headless:amd64 (8u212-b03-0ubuntu1.18.04.1) over (8u181-b13-1ubuntu0.18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/openjdk-8-jre-headless_8u212-b03-0ubuntu1.18.04.1_amd64.deb (--unpack):
 trying to overwrite shared '/etc/java-8-openjdk/calendars.properties', which is different from other instances of package openjdk-8-jre-headless:amd64
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/openjdk-8-jre-headless_8u212-b03-0ubuntu1.18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

[NB - following commands run AFTER using Synaptic Package Manager to edit Repository and Software Updater to successfully update the system]

gnace@gn-limbo:~/Downloads$ cat /etc/apt/sources.list
# deb cdrom:[Ubuntu 17.10 _Artful Aardvark_ - Release amd64 (20180105.1)]/ artful main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe restricted main multiverse #Added by software-properties
# deb-src http://us.archive.ubuntu.com/ubuntu/ artful main restricted

## Major bug fix updates produced after the final release of the
## distribut...

Read more...

Revision history for this message
George Nace (gnace) wrote :

This was finally fixed by removing the webupd8team PPA from the repositories. I thought I had removed them completely, but one was still checked. I also had to follow the instructions in the first answer to the question:

https://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre

I followed the manual download and install steps, plus the steps for NetBeans which failed. I rebuilt my cache using the commandline in Terminal:

> sudo apt --fix-broken install

Conclusion: I think that other developers and/or users will experience this area and be similarly frustrated in finding the answer. Perhaps it could in part be addressed by updating the WEB UPD8 blog referenced below with a 2019 date in the uri. It would also be nice to have it support HTTPS Everywhere as it doesn't convert to an https:// address on my web browsers (Chromium or Firefox):

http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

For my system you can consider this issue resolved. Feel free to contact me if you have any questions: <gnace(at)ieee.org>

Revision history for this message
Manfred Hampl (m-hampl) wrote :

Possible workaround for such problem:

sudo apt -o Dpkg::Options::="--force-overwrite" [other apt command options and parameters]

Revision history for this message
Feng Sian (feng.sian) wrote :

I also had the same issue, have fixed it [by disabling the webupd8team repositories, but some days ago I went again into the same issue again.
Finally, the workaround from Manfred Hampl worked out at the first attempt (actually, on the second attempt, as I forgot to add the '--fix-broken install' apt parameters).

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in openjdk-8 (Ubuntu):
status: New → Confirmed
Revision history for this message
Przemek K. (azrael) wrote :

Similar bug: 1890592
I've solved it by removing JRE8 packages.

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

duplicate of https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1916327 (different filename but same root cause)

Changed in openjdk-8 (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.