Apt repository does not have a Release file for focal

Trying to build a docker container with terraform installed but getting

The repository 'https://apt.releases.hashicorp.com focal Release' does not have a Release file.

The dockerfile step is

RUN wget -O- https://apt.releases.hashicorp.com/gpg | \
    gpg --dearmor | \
    sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null && \
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list && \
    apt-get update && apt-get install -y terraform && \
    apt-get clean && rm -rf /var/lib/apt/lists/*
1 Like

Same problem here.
Just stopped working

2 Likes

same problem here:

0.922 Err:11 https://apt.releases.hashicorp.com focal Release
0.929 Reading package lists...
1.384 E: The repository 'https://apt.releases.hashicorp.com focal Release' does not have a Release file.

I believe this might correlate with the EOL of Ubuntu 20.04 (Focal Fossa) being May 2025.
With Ubuntu 24.04 everything works as expected.
=> They might have removed the apt repo config for the old Ubuntu version