{"id":5439,"date":"2026-09-14T11:08:07","date_gmt":"2026-09-14T11:08:07","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=5439"},"modified":"2026-09-14T11:08:07","modified_gmt":"2026-09-14T11:08:07","slug":"ansible-error-gpg-error","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=5439","title":{"rendered":"Ansible Error &#8211; GPG Error"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I was getting the following error with Ansible when running a Playbook against a server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https:\/\/apt.releases.hashicorp.com noble InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FC9CA96ACA026560<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It turned out that Ansible was attempting to perform an &#8220;apt update&#8221; and failing, but just ended up timing out.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Manually running &#8220;apt update&#8221; then gave the following error, which was what was tripping up the Playbook and causing it to time out.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Hit:4 https:\/\/ubuntu-mirrors.internal.sanger.ac.uk\/noble noble-updates InRelease\nHit:5 https:\/\/ubuntu-mirrors.internal.sanger.ac.uk\/noble noble-security InRelease\nHit:6 https:\/\/ubuntu-mirrors.internal.sanger.ac.uk\/noble noble-backports InRelease\nErr:7 https:\/\/apt.releases.hashicorp.com noble InRelease\n  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FC9CA96ACA026560\nFetched 29.4 kB in 1s (49.0 kB\/s)\nReading package lists... Done\nBuilding dependency tree... Done\nReading state information... Done\n2 packages can be upgraded. Run 'apt list --upgradable' to see them.\nW: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https:\/\/apt.releases.hashicorp.com noble InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FC9CA96ACA026560\nW: Failed to fetch https:\/\/apt.releases.hashicorp.com\/dists\/noble\/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FC9CA96ACA026560\nW: Some index files failed to download. They have been ignored, or old ones used instead.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To resolve this I just needed to ensure that (in this case) the Hashicorp GPG key was updated. First find the source with the cat, then remove the GPG public key and re-download.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># cat \/etc\/apt\/sources.list.d\/hashicorp.list \ndeb &#91;signed-by=\/usr\/share\/keyrings\/hashicorp-archive-keyring.gpg] https:\/\/apt.releases.hashicorp.com jammy main\n\n# rm \/usr\/share\/keyrings\/hashicorp-archive-keyring.gpg\n\n#curl https:\/\/apt.releases.hashicorp.com\/gpg | gpg --dearmor > \/usr\/share\/keyrings\/hashicorp-archive-keyring.gpg<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Re-run &#8220;apt update&#8221;, if it works, you should be good to re-run the Ansible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was getting the following error with Ansible when running a Playbook against a server: It turned out that Ansible was attempting to perform an &#8220;apt update&#8221; and failing, but just ended up timing out. Manually running &#8220;apt update&#8221; then gave the following error, which was what was tripping up the Playbook and causing it &#8230; <a title=\"Ansible Error &#8211; GPG Error\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=5439\" aria-label=\"Read more about Ansible Error &#8211; GPG Error\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":4522,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[],"class_list":["post-5439","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ansible"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/5439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5439"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/5439\/revisions"}],"predecessor-version":[{"id":5440,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/5439\/revisions\/5440"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/4522"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}