Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

apt prints 'Missing Signed-By in the sources.list(5) entry'

ErrorN: Missing Signed-By in the sources.list(5) entry for 'http://mirrors.linode.com/ubuntu'

Short answer

The notice means a repository entry has no Signed-By option, so apt accepts any key in its global trusted keyrings for it. Find the entry that names the host, store that vendor's key as a file in /etc/apt/keyrings, and add Signed-By pointing to that file in the entry.

  • Applies to apt 2.7, Ubuntu 24.04, Debian 12
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Search every apt source file for the host named in the notice, to see which file and which format the entry is in.

    grep -rn 'mirrors.linode.com' /etc/apt/sources.list /etc/apt/sources.list.d/
  2. 2Match what you see, then jump to its fix

    1. 1N: Missing Signed-By for one host, listed after sudo apt updateThe repository line has no signed-by optionFix
    2. 2the key sits in /etc/apt/trusted.gpg or /etc/apt/trusted.gpg.d, or was added with apt-keyThe key was added to the global trust storeFix
    3. 3apt update errors or warnings only for artifacts.elastic.coThe Elasticsearch repository was added in an old wayFix

What does the error look like?

  • N: Missing Signed-By in the sources.list(5) entry for 'http://mirrors.linode.com/ubuntu'
  • N: Missing Signed-By

Cause 1 of 3

The repository line has no signed-by option

1Check

Without Signed-By, all keys in the trusted keyrings count as valid signers for the repository. Open the file you found and see whether the entry has the option.

cat /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources

2Fix

Put the vendor's key into /etc/apt/keyrings as a binary file, then add Signed-By with that path. In a .sources file it is a line in the stanza; in a one-line .list file it is signed-by inside square brackets.

sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://example.com/repo-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/example.gpg

# /etc/apt/sources.list.d/example.sources
Types: deb
URIs: https://example.com/apt
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/example.gpg

3Verify

Run the update again and look for the notice.

sudo apt update

Confirmed by wiki.debian.org

Did this fix it?

Cause 2 of 3

The key was added to the global trust store

1Check

When no keyring is given, the default is trusted.gpg and everything in trusted.gpg.d. A key placed there is accepted for every repository without Signed-By, not just its own.

ls -l /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/

2Fix

Move the vendor key out of the global store into its own keyring file under /etc/apt/keyrings and point only that repository's Signed-By at it. Never place a third-party key in trusted.gpg.d.

# Signed-By in the repository entry, pointing to the vendor's own file
Signed-By: /etc/apt/keyrings/example.gpg

3Verify

Update and install from that repository.

sudo apt update && apt-cache policy example-package

Confirmed by manpages.debian.org

Did this fix it?

Cause 3 of 3

The Elasticsearch repository was added in an old way

1Check

Elastic documents one setup: the key converted with gpg --dearmor into /usr/share/keyrings/elasticsearch-keyring.gpg, and a repository line that uses signed-by. A repository line without it, or a key that is missing, breaks update.

cat /etc/apt/sources.list.d/elastic-*.list

2Fix

Redo the setup with Elastic's own steps for the major version you use. Check the current version number on the Elastic page; 9.x is shown there as the example.

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/9.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-9.x.list

3Verify

Update the package index and install.

sudo apt-get update && sudo apt-get install elasticsearch

Confirmed by elastic.co

Did this fix it?

How do I stop it coming back?

  • Give each third-party repository its own keyring file and its own Signed-By.
  • Do not use apt-key add or trusted.gpg.d for third-party keys.
  • Keep keys you manage by hand in /etc/apt/keyrings.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Servers

dnf cannot install MySQL on Amazon Linux 2023

dnf cannot find a mysql-server package on Amazon Linux 2023

Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.