I'm trying to install Corretto 25 on my EC2 instance running Amazon Linux 2023. I've previously installed and uninstalled Corretto 21 without any issues using the following commands: `sudo yum install java-21-amazon-corretto-devel` and `sudo yum remove java-21-amazon-corretto-devel`. However, when I attempt the same process for Corretto 25, I get an error saying it can't find the package. I've tested this with various attempts, like `sudo yum install java-25-amazon-corretto`, but the result is always the same: 'No match for argument: java-25-amazon-corretto-devel'. I checked and confirmed that my EC2 is indeed running Amazon Linux 2023. Can anyone help me figure out what I'm missing? Also, I found out that Corretto 25 was released in late September, so I thought I might need to update my OS. Thanks!
2 Answers
You likely need to update your dnf release version since Corretto 25's release might not have made it into your current repo setup. Try running this command to get the latest updates:
**sudo dnf --releasever=latest update** and then give the installation a shot again!
It looks like you might not have the right repository enabled for Corretto 25. You should try running these commands to import the repository key and add the correct repo:
```
sudo rpm --import https://yum.corretto.aws/corretto.key
sudo curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo
```
Does it even matter? I thought yum and dnf lead to the same thing anyway! Just checked, and they do.

That worked for me! I had updated not long ago, but I didn’t realize Corretto 25 came out later than I thought.