amazonlinux / amazon-linux-2023

Amazon Linux 2023
https://aws.amazon.com/linux/amazon-linux-2023/
Other
501 stars 38 forks source link

[Bug] - java-17-amazon-corretto-headless and java-21-amazon-corretto-headless provide the same file(s) #544

Closed pluralistix closed 7 months ago

pluralistix commented 8 months ago

Describe the bug ATM it is not possible to install java-17-amazon-corretto-devel and java-21-amazon-corretto-devel at the same time (next to each other), as dnf install fails.

To Reproduce

docker run public.ecr.aws/amazonlinux/amazonlinux:2023 bash -c 'dnf install java-21-amazon-corretto-devel java-17-amazon-corretto-devel -y'
❯ docker run public.ecr.aws/amazonlinux/amazonlinux:2023 bash -c 'dnf whatprovides /usr/lib/.build-id/0a/66f003181295d8e3399ebbb4b23f5d79fdb311'
Amazon Linux 2023 repository                    6.8 MB/s |  21 MB     00:03
Last metadata expiration check: 0:00:04 ago on Wed Nov  8 08:55:34 2023.
java-17-amazon-corretto-headless-1:17.0.9+8-1.amzn2023.1.x86_64 : Amazon Corretto headless development environment
Repo        : amazonlinux
Matched from:
Filename    : /usr/lib/.build-id/0a/66f003181295d8e3399ebbb4b23f5d79fdb311

java-21-amazon-corretto-headless-1:21.0.0+35-1.amzn2023.1.x86_64 : Amazon Corretto headless development environment
Repo        : amazonlinux
Matched from:
Filename    : /usr/lib/.build-id/0a/66f003181295d8e3399ebbb4b23f5d79fdb311

java-21-amazon-corretto-headless-1:21.0.1+12-1.amzn2023.1.x86_64 : Amazon Corretto headless development environment
Repo        : amazonlinux
Matched from:
Filename    : /usr/lib/.build-id/0a/66f003181295d8e3399ebbb4b23f5d79fdb311

Expected behavior Both packages can be installed and can coexist.

Additional context Installing an "older" version of either the JDK 17 works. e.g.

docker run public.ecr.aws/amazonlinux/amazonlinux:2023 bash -c 'dnf install java-21-amazon-corretto-devel java-17-amazon-corretto-devel-1:17.0.8+8-1.amzn2023.1.x86_64 -y'
nmeyerhans commented 8 months ago

This issue was first raised in #530. A fix is pending and will be included in an upcoming release.

nmeyerhans commented 7 months ago

This is resolved as of the 2023.2.20231113 release.

dss010101 commented 7 months ago

should this work?

RUN dnf -y install java-21-amazon-corretto-headless

cause im getting:

#0 0.584 No match for argument: java-21-amazon-corretto-headless
#0 0.592 Error: Unable to find a match: java-21-amazon-corretto-headless
nmeyerhans commented 7 months ago

@dss010101 Yes, but it didn't exist in older AL2023 releases. Make sure you're running on a newer AMI, or passing a current --releasever= , e.g. dnf --releasever=2023.2.20231113 install java-21-amazon-corretto-headless