Unable to Fetch Some Archives in Ubuntu When Installing Java

Updated

A Java coffee cup beside a package box marked with a red cross, showing a failed Java install on Ubuntu

The error names a URL. Fetch that URL yourself and the cause is usually obvious in one command.

curl -o /dev/null -s -w '%{http_code}\n' \
  https://ppa.launchpadcontent.net/linuxuprising/java/ubuntu/dists/$(lsb_release -cs)/Release

A 404 means the repository you added no longer publishes anything for your release, and no amount of apt-get update will change that. Delete the file under /etc/apt/sources.list.d/ that added it. On Ubuntu 26.04 you probably never needed it: sudo apt install openjdk-26-jdk installs from Ubuntu’s own archive. The same has quietly become true of the other runtime people add a third-party repository for — .NET installs from the distribution’s own packages now, with no Microsoft repository step.

The Java repositories that produce this error, checked in August 2026

Nearly every “install Java on Ubuntu” tutorial written between about 2014 and 2020 tells you to add one of two PPAs. Both are dead. Probed on 11 August 2026 against Ubuntu 26.04’s codename, resolute:

404  https://ppa.launchpadcontent.net/webupd8team/java/ubuntu/dists/resolute/Release
404  https://ppa.launchpadcontent.net/linuxuprising/java/ubuntu/dists/resolute/Release
200  https://ppa.launchpadcontent.net/openjdk-r/ppa/ubuntu/dists/noble/Release

If either of the first two is in your sources, every apt-get update fails on it forever. The third, openjdk-r, still answers — a reminder that “PPA in an old tutorial” is not automatically the culprit, and that you have to check the specific one.

Adoptium is alive, but not for every Ubuntu release

The current recommendation is Eclipse Temurin from packages.adoptium.net. That repository is healthy, but it does not build for every codename, and guides that construct the URL with $(lsb_release -cs) break silently on the ones it skips. Same probe, one codename per line:

jammy    (22.04) -> HTTP 200
noble    (24.04) -> HTTP 200
oracular (24.10) -> HTTP 200
plucky   (25.04) -> HTTP 404
questing (25.10) -> HTTP 404
resolute (26.04) -> HTTP 200

Codenames confirmed from each suite’s own Release file on archive.ubuntu.com (Suite: resolute, Version: 26.04). So on 25.04 or 25.10 the Adoptium line is the fetch failure, and the fix is to point it at the nearest LTS codename or use the distro packages. For the record, the resolute repository, as of August 2026, publishes temurin-8/11/17/21/25/26 in both -jdk and -jre form, read from its own Packages index.

It is not an expired signing key

“Expired repository key” is the other stock answer, and for Adoptium it is wrong. Downloading their published key and asking gnupg:

$ gpg --show-keys adoptium.key
pub   rsa2048 2021-11-16 [SC]
      3B04D753C9050D9A5D343F39843C48A565F8F04B
uid   Adoptium GPG Key (DEB/RPM Signing Key) <temurin-dev@eclipse.org>
sub   rsa2048 2021-11-16 [E]

No expiry date is printed, and the machine-readable form (--with-colons) has an empty expiration field. This key does not expire, so a signature error against Adoptium is a wrong keyring path or a missing signed-by, not an expiry. The keyring pattern that works is the same one used in the pgAdmin repository setup: dearmor the key into /usr/share/keyrings/ and reference it with signed-by= in the source entry.

Two apt-get commands that do not do what people expect

apt-get update --fix-missing. update does not download packages, so there is nothing for the flag to hold back. The apt-get man page describes update as: “used to resynchronize the package index files from their sources”, and --fix-missing as: “Ignore missing packages; if packages cannot be retrieved or fail the integrity check after retrieval (corrupted package files), hold back those packages and handle the result… If a package is selected for installation (particularly if it is mentioned on the command line) and it could not be downloaded then it will be silently held back.” That is an install/upgrade flag. It is accepted on update and changes nothing about a 404.

apt-get upgrade --fix-broken. The documented use is with install or remove — “This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution.” The command people actually want is sudo apt --fix-broken install. The same man page also warns that -f and -m together “may produce an error in some situations”, which is worth knowing before you paste both.

And one file that has moved

Since 24.04 Ubuntu’s own entries are not in /etc/apt/sources.list — they are in /etc/apt/sources.list.d/ubuntu.sources in deb822 format. The Ubuntu specification for the change states plainly: “The default default sources list should be /etc/apt/sources.list.d/ubuntu.sources instead of /etc/apt/sources.list“, and that on upgrade the release upgrader “should remove Ubuntu entries from sources.list and write them /etc/apt/sources.list.d/ubuntu.sources“. Grep both locations, not one:

grep -rn --include='*.list' --include='*.sources' -E 'java|adoptium|temurin' \
  /etc/apt/sources.list /etc/apt/sources.list.d/

What was run here, and what was not

The HTTP status codes, the codename lookups and the gnupg key inspection above were executed from macOS 26.6 on 11 August 2026 and are reproducible from any machine with curl and gpg. The falsifier for the repository probes is fetch-error-installing-java-ubuntu.sh; it needs network access and skips cleanly without it. No Ubuntu or Debian system was used, so nothing about apt’s own output was observed first-hand; the apt behaviour above is quoted from the Ubuntu apt-get(8) and sources.list(5) man pages and the Ubuntu deb822 specification. Once a JDK is installed, checking which one you actually got is covered in the JDK distribution comparison rather than repeated here.

Photo of author
Sudhir P. founded HeatWare.com in 1999 and has built and operated it full-stack ever since; it is now used by more than 88,000 people. He writes here about the PostgreSQL, MySQL, Linux and DevOps work that keeps it running. Articles are rewritten only after the commands in them have actually been run, and the verification scripts are published alongside them so anyone can check the claims. Reach him at blog@heatware.net.