how to install amazon Corretto 17 on centos

3.3k views Asked by At

I need to install jdk 17 on centos7. When I try the yum install, I get the below message

sudo yum install -y java-17-amazon-corretto-devel

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * fasttrack: mirror.centos.org
No package java-17-amazon-corretto-devel available.
Error: Nothing to do

I tried to follow https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/generic-linux-install.html(Using yum section). When I run the command to import corretto key, it times out. I tried the yum install -y java-17-openjdk-devel, i get the same error

yum install -y java-17-openjdk-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * fasttrack: mirror.centos.org
No package java-17-openjdk-devel available.
Error: Nothing to do

Does anyone know the solution?

1

There are 1 answers

0
Tobsi On

I had the same error and had a look here: https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/generic-linux-install.html

You need to run the following before installing:

 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