Sunday, June 6, 2021

Install Amazon Corretto 8 on RPM-Based Linux

Using yum
To use Corretto RPM repositories with the yum package manager (such as Amazon Linux AMI), import the Corretto public key and then add the repository to the system list. For most systems, you must run the following commands:

 $ 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

After the repository is added, you can install Corretto 8 by running this command:

$ sudo yum install -y java-1.8.0-amazon-corretto-devel




login as: ec2-user
Authenticating with public key "imported-openssh-key"
Last login: Mon Jun  7 22:02:06 2021 from ec2-18-206-107-25.compute-1.amazonaws.                                                                                                                                                             com

       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/
[ec2-user@ip-172-31-81-123 ~]$ sudo rpm --import https://yum.corretto.aws/corret                                                                                                                                                           to.key
[ec2-user@ip-172-31-81-123 ~]$ sudo curl -L -o /etc/yum.repos.d/corretto.repo ht                                                                                                                                                             tps://yum.corretto.aws/corretto.repo
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   147  100   147    0     0   6391      0 --:--:-- --:--:-- --:--:--  6391
[ec2-user@ip-172-31-81-123 ~]$ sudo yum install -y java-1.8.0-amazon-corretto-de                                                                                                                                                             vel
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
AmazonCorretto                                           | 2.9 kB     00:00
amzn2-core                                               | 3.7 kB     00:00
AmazonCorretto/x86_64/primary_db                           |  27 kB   00:00
Resolving Dependencies
--> Running transaction check
---> Package java-1.8.0-amazon-corretto-devel.x86_64 1:1.8.0_292.b10-1 will be i                                                                                                                                                             nstalled
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                          Arch   Version           Repository      Size
================================================================================
Installing:
 java-1.8.0-amazon-corretto-devel x86_64 1:1.8.0_292.b10-1 AmazonCorretto 112 M

Transaction Summary
================================================================================
Install  1 Package

Total download size: 112 M
Installed size: 210 M
Downloading packages:
java-1.8.0-amazon-corretto-devel-1.8.0_292.b10-1.x86_64.rp | 112 MB   00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:java-1.8.0-amazon-corretto-devel-1.8.0_292.b10-1.x86_64                                                                                                                                                                 1/1
  Verifying  : 1:java-1.8.0-amazon-corretto-devel-1.8.0_292.b10-1.x86_64                                                                                                                                                                 1/1

Installed:
  java-1.8.0-amazon-corretto-devel.x86_64 1:1.8.0_292.b10-1

Complete!
[ec2-user@ip-172-31-81-123 ~]$

[ec2-user@ip-172-31-81-123 ~]$ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment Corretto-8.292.10.1 (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM Corretto-8.292.10.1 (build 25.292-b10, mixed mode)
[ec2-user@ip-172-31-81-123 ~]$

No comments:

Post a Comment