RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2008206 - reinstalling openjdk packages removes alternatives links [rhel-9, openjdk-17]
Summary: reinstalling openjdk packages removes alternatives links [rhel-9, openjdk-17]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: java-17-openjdk
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: jiri vanek
QA Contact: OpenJDK QA
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-27 15:14 UTC by Andrew John Hughes
Modified: 2022-05-17 14:06 UTC (History)
1 user (show)

Fixed In Version: java-17-openjdk-17.0.2.0.8-10.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 14:06:28 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-98263 0 None None None 2021-09-27 15:15:54 UTC

Description Andrew John Hughes 2021-09-27 15:14:13 UTC
This bug was initially created as a copy of Bug #1976053

I am copying this bug because: 

Sync with RHEL 8 RPMs

Description of problem:

If you reinstall one of the following packages it causes the alternatives links to be removed from the system:
java-1.8.0-openjdk-headless
java-1.8.0-openjdk-devel
java-11-openjdk-headless
java-11-openjdk-devel

How reproducible:

Always

Steps to Reproduce:
1. dnf install java-1.8.0-openjdk-headless
2. ls -lh /usr/bin/java
3. dnf reinstall java-1.8.0-openjdk-headless
4. ls -lh /usr/bin/java

Actual results:

[root@rhel8 ~]# dnf install java-1.8.0-openjdk-headless
...
Installed:
  copy-jdk-configs-3.7-4.el8.noarch     java-1.8.0-openjdk-headless-1:1.8.0.292.b10-1.el8_4.x86_64     javapackages-filesystem-5.3.0-1.module+el8+2447+6f56d9a6.noarch     libjpeg-turbo-1.5.3-10.el8.x86_64    
  lksctp-tools-1.0.18-3.el8.x86_64      lua-5.3.4-11.el8.x86_64                                        tzdata-java-2021a-1.el8.noarch                                     

Complete!
[root@rhel8 ~]# ls -lh /usr/bin/java
lrwxrwxrwx. 1 root root 22 Jun 25 15:41 /usr/bin/java -> /etc/alternatives/java
[root@rhel8 ~]# dnf reinstall java-1.8.0-openjdk-headless
...
Reinstalled:
  java-1.8.0-openjdk-headless-1:1.8.0.292.b10-1.el8_4.x86_64                                                                                                                                                       

Complete!
[root@rhel8 ~]# ls -lh /usr/bin/java
ls: cannot access '/usr/bin/java': No such file or directory

Expected results:

The link should still be there after the reinstall.

Additional info:

This bug seems to affect all the openjdk packages that install alternatives links.  I have verified it with the packages listed above.

The alternatives --removes commands in the postinstall scriptlets should be wrapped in `if [ "$1" = 0 ]; then ... fi` which will result in the removal only happening on an actual uninstall, and not an update or reinstall.

Comment 14 errata-xmlrpc 2022-05-17 14:06:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: java-17-openjdk), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2647


Note You need to log in before you can comment on or make changes to this bug.