{
    "content": [
        {
            "type": "text",
            "text": "# apt-key (man)\n\n## NAME\n\napt-key - Deprecated APT key management utility\n\n## SYNOPSIS\n\napt-key [--keyring filename] {add filename | del keyid | export keyid | exportall | list |\nfinger | adv | update | net-update | {-v | --version} | {-h | --help}}\n\n## DESCRIPTION\n\napt-key is used to manage the list of keys used by apt to authenticate packages. Packages\nwhich have been authenticated using these keys will be considered trusted.\n\n## TLDR\n\n> Key management utility for the APT Package Manager on Debian and Ubuntu.\n\n- List trusted keys:\n  `apt-key list`\n- Add a key to the trusted keystore:\n  `apt-key add {{public_key_file.asc}}`\n- Delete a key from the trusted keystore:\n  `apt-key del {{key_id}}`\n- Add a remote key to the trusted keystore:\n  `wget {{-qO|--quiet --output-document}} - {{https://host.tld/filename.key}} | apt-key add -`\n- Add a key from keyserver with only key ID:\n  `apt-key adv --keyserver {{pgp.mit.edu}} --recv {{key_id}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **SUPPORTED KEYRING FILES**\n- **COMMANDS** (4 subsections)\n- **OPTIONS**\n- **DEPRECATION**\n- **FILES**\n- **SEE ALSO**\n- **BUGS**\n- **AUTHOR**\n- **AUTHORS** (2 subsections)\n- **NOTES**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "apt-key",
        "section": "",
        "mode": "man",
        "summary": "apt-key - Deprecated APT key management utility",
        "synopsis": "apt-key [--keyring filename] {add filename | del keyid | export keyid | exportall | list |\nfinger | adv | update | net-update | {-v | --version} | {-h | --help}}",
        "tldr_summary": "Key management utility for the APT Package Manager on Debian and Ubuntu.",
        "tldr_examples": [
            {
                "description": "List trusted keys",
                "command": "apt-key list"
            },
            {
                "description": "Add a key to the trusted keystore",
                "command": "apt-key add {{public_key_file.asc}}"
            },
            {
                "description": "Delete a key from the trusted keystore",
                "command": "apt-key del {{key_id}}"
            },
            {
                "description": "Add a remote key to the trusted keystore",
                "command": "wget {{-qO|--quiet --output-document}} - {{https://host.tld/filename.key}} | apt-key add -"
            },
            {
                "description": "Add a key from keyserver with only key ID",
                "command": "apt-key adv --keyserver {{pgp.mit.edu}} --recv {{key_id}}"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "apt-get",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/apt-get/8/json"
            },
            {
                "name": "apt-secure",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/apt-secure/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "SUPPORTED KEYRING FILES",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "COMMANDS",
                "lines": 18,
                "subsections": [
                    {
                        "name": "exportall (deprecated)",
                        "lines": 5
                    },
                    {
                        "name": "adv (deprecated)",
                        "lines": 5
                    },
                    {
                        "name": "update (deprecated)",
                        "lines": 9
                    },
                    {
                        "name": "net-update (deprecated)",
                        "lines": 6
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DEPRECATION",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Jason Gunthorpe",
                        "lines": 1
                    },
                    {
                        "name": "APT team",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "apt-key - Deprecated APT key management utility\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "apt-key [--keyring filename] {add filename | del keyid | export keyid | exportall | list |\nfinger | adv | update | net-update | {-v | --version} | {-h | --help}}\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "apt-key is used to manage the list of keys used by apt to authenticate packages. Packages\nwhich have been authenticated using these keys will be considered trusted.\n\nUse of apt-key is deprecated, except for the use of apt-key del in maintainer scripts to\nremove existing keys from the main keyring. If such usage of apt-key is desired the\nadditional installation of the GNU Privacy Guard suite (packaged in gnupg) is required.\n\napt-key(8) will last be available in Debian 11 and Ubuntu 22.04.\n",
                "subsections": []
            },
            "SUPPORTED KEYRING FILES": {
                "content": "apt-key supports only the binary OpenPGP format (also known as \"GPG key public ring\") in\nfiles with the \"gpg\" extension, not the keybox database format introduced in newer gpg(1)\nversions as default for keyring files. Binary keyring files intended to be used with any apt\nversion should therefore always be created with gpg --export.\n\nAlternatively, if all systems which should be using the created keyring have at least apt\nversion >= 1.4 installed, you can use the ASCII armored format with the \"asc\" extension\ninstead which can be created with gpg --armor --export.\n",
                "subsections": []
            },
            "COMMANDS": {
                "content": "add filename (deprecated)\nAdd a new key to the list of trusted keys. The key is read from the filename given with\nthe parameter filename or if the filename is - from standard input.\n\nIt is critical that keys added manually via apt-key are verified to belong to the owner\nof the repositories they claim to be for otherwise the apt-secure(8) infrastructure is\ncompletely undermined.\n\nNote: Instead of using this command a keyring should be placed directly in the\n/etc/apt/trusted.gpg.d/ directory with a descriptive name and either \"gpg\" or \"asc\" as\nfile extension.\n\ndel keyid (mostly deprecated)\nRemove a key from the list of trusted keys.\n\nexport keyid (deprecated)\nOutput the key keyid to standard output.\n",
                "subsections": [
                    {
                        "name": "exportall (deprecated)",
                        "content": "Output all trusted keys to standard output.\n\nlist, finger (deprecated)\nList trusted keys with fingerprints.\n"
                    },
                    {
                        "name": "adv (deprecated)",
                        "content": "Pass advanced options to gpg. With adv --recv-key you can e.g. download key from\nkeyservers directly into the trusted set of keys. Note that there are no checks\nperformed, so it is easy to completely undermine the apt-secure(8) infrastructure if used\nwithout care.\n"
                    },
                    {
                        "name": "update (deprecated)",
                        "content": "Update the local keyring with the archive keyring and remove from the local keyring the\narchive keys which are no longer valid. The archive keyring is shipped in the\narchive-keyring package of your distribution, e.g. the ubuntu-keyring package in Ubuntu.\n\nNote that a distribution does not need to and in fact should not use this command any\nlonger and instead ship keyring files in the /etc/apt/trusted.gpg.d/ directory directly\nas this avoids a dependency on gnupg and it is easier to manage keys by simply adding and\nremoving files for maintainers and users alike.\n"
                    },
                    {
                        "name": "net-update (deprecated)",
                        "content": "Perform an update working similarly to the update command above, but get the archive\nkeyring from a URI instead and validate it against a master key. This requires an\ninstalled wget(1) and an APT build configured to have a server to fetch from and a master\nkeyring to validate. APT in Debian does not support this command, relying on update\ninstead, but Ubuntu's APT does.\n"
                    }
                ]
            },
            "OPTIONS": {
                "content": "Note that options need to be defined before the commands described in the previous section.\n\n--keyring filename (deprecated)\nWith this option it is possible to specify a particular keyring file the command should\noperate on. The default is that a command is executed on the trusted.gpg file as well as\non all parts in the trusted.gpg.d directory, though trusted.gpg is the primary keyring\nwhich means that e.g. new keys are added to this one.\n",
                "subsections": []
            },
            "DEPRECATION": {
                "content": "Except for using apt-key del in maintainer scripts, the use of apt-key is deprecated. This\nsection shows how to replace existing use of apt-key.\n\nIf your existing use of apt-key add looks like this:\n\nwget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -\n\nThen you can directly replace this with (though note the recommendation below):\n\nwget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc\n\nMake sure to use the \"asc\" extension for ASCII armored keys and the \"gpg\" extension for the\nbinary OpenPGP format (also known as \"GPG key public ring\"). The binary OpenPGP format works\nfor all apt versions, while the ASCII armored format works for apt version >= 1.4.\n\nRecommended: Instead of placing keys into the /etc/apt/trusted.gpg.d directory, you can place\nthem anywhere on your filesystem by using the Signed-By option in your sources.list and\npointing to the filename of the key. See sources.list(5) for details. Since APT 2.4,\n/etc/apt/keyrings is provided as the recommended location for keys not managed by packages.\nWhen using a deb822-style sources.list, and with apt version >= 2.4, the Signed-By option can\nalso be used to include the full ASCII armored keyring directly in the sources.list without\nan additional file.\n",
                "subsections": []
            },
            "FILES": {
                "content": "/etc/apt/trusted.gpg\nKeyring of local trusted keys, new keys will be added here. Configuration Item:\nDir::Etc::Trusted.\n\n/etc/apt/trusted.gpg.d/\nFile fragments for the trusted keys, additional keyrings can be stored here (by other\npackages or the administrator). Configuration Item Dir::Etc::TrustedParts.\n\n/etc/apt/keyrings/\nPlace to store additional keyrings to be used with Signed-By.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "apt-get(8), apt-secure(8)\n",
                "subsections": []
            },
            "BUGS": {
                "content": "APT bug page[1]. If you wish to report a bug in APT, please see\n/usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "APT was written by the APT team <apt@packages.debian.org>.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Jason Gunthorpe",
                        "content": ""
                    },
                    {
                        "name": "APT team",
                        "content": ""
                    }
                ]
            },
            "NOTES": {
                "content": "1. APT bug page\nhttp://bugs.debian.org/src:apt\n\n\n\nAPT 2.4.14                                22 February 2022                                APT-KEY(8)",
                "subsections": []
            }
        }
    }
}