Skip to main content
Repository errors mean apt update or dnf couldn’t fetch or trust a package source. The error names the repository: most often it is a third-party repository with the wrong release name or a missing signing key, a server clock that is wrong, or DNS that doesn’t work. Read which repository fails, then fix or disable that one source. The table below matches each message to its fix.

Before you start

  • Run sudo apt update or sudo dnf makecache and copy the first error line. Later lines often repeat it.
  • Repository files live in /etc/apt/sources.list.d/ (and /etc/apt/sources.list) on Ubuntu and Debian, and in /etc/yum.repos.d/ on AlmaLinux and Rocky. Ubuntu 24.04 keeps its own sources in /etc/apt/sources.list.d/ubuntu.sources.
  • Use only supported releases (Ubuntu 22.04/24.04, Debian 12/13, AlmaLinux and Rocky 9/10). Repositories for end-of-life releases are moved or removed, which causes these errors.
  • Commands use sudo. As root, leave it out.

Which error do you have?

Cause 1: Wrong release name (does not have a Release file)

Check your release code name and the failing line:
Replace jammy with the name the error shows. Fix: set the repository to your code name (noble for Ubuntu 24.04, jammy for 22.04, trixie for Debian 13, bookworm for Debian 12), but only if the vendor publishes packages for it. If they don’t, disable the file by renaming it, then run sudo apt update:

Cause 2: Missing signing key (NO_PUBKEY)

APT refuses unsigned or unverifiable repositories by default. Fix: download the key from the vendor’s own installation page into /etc/apt/keyrings, and reference it with signed-by:
Armored keys must end in .asc, binary keys in .gpg. Don’t use apt-key; it is deprecated.

Cause 3: The server clock is wrong (not valid yet)

Check: timedatectl should show System clock synchronized: yes and the correct time. Fix: turn on time sync with sudo timedatectl set-ntp true. See set the timezone and time sync.

Cause 4: DNS doesn’t work

Temporary failure resolving 'archive.ubuntu.com' or Curl error (6): Couldn't resolve host name means the server can’t look up names. Fix DNS first: see temporary failure in name resolution.

Cause 5: dnf can’t download repository metadata

Check which repository fails and whether the others work:
Fix, in this order:
If one repository still fails, skip it for one command to finish urgent work, then fix or disable it:
A common case is an add-on repository (such as EPEL or a vendor repository) installed for another major version, for example el8 packages on AlmaLinux 9. Remove its release package and install the one for your version, as the vendor documents. dnf config-manager comes from the dnf-plugins-core package.

Cause 6: Bad download or duplicate entries

For Hash Sum mismatch or File has unexpected size, wait a few minutes (the mirror may be updating), then clear the downloaded lists and fetch them again:
For configured multiple times, the warning names two files and line numbers. Delete one of the duplicate lines.

How to check it worked

It should end without E: or W: lines. On AlmaLinux and Rocky, sudo dnf makecache should end with Metadata cache created.

Frequently asked questions

Can I ignore a failing third-party repository?

APT still updates the other repositories, but you get no updates from that one, which can include security fixes. Fix or disable it.

Should I use [trusted=yes] to get rid of NO_PUBKEY?

No. It turns off signature checks, so you would install whatever the repository serves. Add the vendor’s key instead.

My release is end-of-life. How do I fix its repositories?

Upgrade to a supported release instead. See upgrade Ubuntu to a new release or upgrade Debian 12 to Debian 13.

VPS and dedicated server guides

Every guide in this section.

Update Linux packages

apt and dnf updates done right.

Could not get lock

When another install is running.

Name resolution failure

Fix DNS on the server.

Time sync on Linux

Keep the clock correct.

Checked against the official Debian sources.list and apt-secure manuals, the DNF command reference and Red Hat’s guide to managing repositories on 4 November 2026; the “does not have a Release file”, NO_PUBKEY, “not valid yet”, DNS and duplicate-entry messages were reproduced with test sources on Ubuntu 24.04 LTS (apt 2.8.3). The dnf commands were not tested.

Need Extra Help?

If you encounter any issues, our support team is ready to assist:

Save on Your Hosting

Ready to upgrade your hosting? Use code KB20 at checkout for 20% off your first order!

Last Updated: November 2026