AWS Open Source Blog

New update channels for Amazon Corretto releases

Customers using Amazon Corretto, an open source, no-cost, multi-platform, production-ready distribution of the Open Java Development Kit (OpenJDK), have asked us to enable familiar tools that developers and system administrators can use to update their installations. Today we are announcing the official Corretto Yum and Apt repositories, permanent download URLs, and a public Corretto Amazon Elastic Container Registry (ECR) instance. These reduce the effort for our customers to install and update Corretto when integrating with their preferred toolchains.

What are the new ways to install and update Corretto?

For most Linux system administrators, the Corretto Yum and Corretto Apt repositories provide a convenient and familiar way of keeping installations up to date, and are easy to work into existing processes. Alternatively, developers who prefer tools like cURL can now rely on the Corretto Permanent URLs to ensure that their scripts always download the latest Corretto release. Finally, although many customers are happy to download their Docker images from Docker Hub, those who want to remain inside the AWS cloud can now use the Corretto ECR Instance as their source of Docker images.

Installing Corretto on RPM-based Linux

To use the Corretto Yum repositories on RPM-based systems such as Amazon Linux AMI, you will need to import the Corretto public key and then add the repository to the system list. On most systems, you can run the following commands to do so:

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 repo has been added, you can install, for instance, Corretto 11 by running:

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

Corretto updates will then be available via the usual yum toolchain.

You can also install Corretto 8 by using:

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

Installing Corretto on Debian-based Linux

To use the Corretto Apt repositories on Debian-based systems such as Ubuntu, import the Corretto public key and then add the repository to the system list using:

curl https://apt.corretto.aws/corretto.key | sudo apt-key add -
sudo add-apt-repository 'deb https://apt.corretto.aws stable main'

After the repo has been added, you can install, for example, Corretto 11 by running:

sudo apt-get update
sudo apt-get install -y java-11-amazon-corretto-jdk

Corretto updates will then be available via the usual apt toolchain.

You can also install Corretto 8 by using:

sudo apt-get install -y java-1.8.0-amazon-corretto-jdk

Using permanent URLs

Permanent URLs are hosted at corretto.aws and always point to the most recent release of a package. For example, to retrieve the latest Linux Corretto 11 .tgz package using a Permanent URL, run the following from the CLI:

curl -LO https://corretto.aws/downloads/latest/amazon-corretto-11-x64-linux-jdk.tar.gz

The same command can also be used in scripts. The full list of links to all the binary packages that Corretto ships in is available on the Corretto 8 Links and Corretto 11 Links pages.

Using the Corretto ECR instance

To use the Corretto ECR instance, first authenticate a Docker client with the Corretto registry (ID 489478819445 in your region of choice) using your preferred method and then log in to Docker. We recommend using the Amazon ECR Docker Credential Helper. Once you have logged in, Corretto 11 images can be pulled or run using one of the following:

docker pull 489478819445.dkr.ecr.us-west-2.amazonaws.com/corretto11:latest
docker run -it 489478819445.dkr.ecr.us-west-2.amazonaws.com/corretto11:latest /bin/bash

You can see the list of available images using:

aws ecr list-images --region us-west-2 --registry-id 489478819445 --repository-name corretto11

These examples use us-west-2 as the region but you can use them in any region by updating the bolded parts. Note that you will need to use the same region you logged in to. For Corretto 8, use corretto8 instead of corretto11 in the examples above.

Next steps

All of the above is available today and we encourage you to use these new channels to manage your Corretto installations with ease. Please visit the Corretto Documentation pages for additional information.

Dave Currie

Dave Currie

Dave Currie is a Software Development Manager at Amazon Web Services, working on bringing Corretto to the masses. @davidcurrie on Twitter.