You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
apt::key breaks on systems that dont have apt-key #1306
@bwitt : I did some digging into this today to better understand what's going on and when things were getting deprecated. It looks like we marked in the docs that apt-key is deprecated and to ask folks to transition, but we haven't actually done hard deprecations in the codebase. We also still officially support quite a few older OS versions that do have apt-key.
Given that, I'm hesitant to recommend we do a hard-break of the functionality across all OS by doing a new major version release that removes apt-key.
Claude wanted to recommend a full gpg rewrite, but I don't know that we need to go that far. That seems like a lot of code changes for minimal benefits.
What I'm currently thinking:
We do formal deprecation in the code to give runtime warnings to apt-key users who are still using it on older versions, so they know that a major version will remove this in the future.
Add some sort of 'exists' check for apt-key so we can give a real error with direction to use keyring instead, instead of the current method that just fails with the 'could not find a suitable provider' error.
Update the acceptance tests to have different assertions: if apt-key exists, expect the current acceptance test results. If apt-key does not exist, expect the new error. (This would double as a test for the new error in addition to fixing the acceptance tests)
switch lib/puppet/provider/apt_key/apt_key.rb:16 to use optional_commands, and then raise a clear error.
for acceptance tests decide when to expect error or not based on the OS and version; that way a broken image wont expect failure and pass, it'll properly fail the test.
@SugatD has started a new PR (#1337) that will close both this (#1306) and #1307 at the same time. It can also be used for #1272 as well to get Debian 13 tests passing as well since it had the same issue with apt-key
Activity
bwitt commentedon Oct 28, 2026
@jst-cyr thoughts on how to handle this? can we just fail if someone tries to use this where it is not supported?
jst-cyr commentedon Oct 29, 2026
@bwitt : I did some digging into this today to better understand what's going on and when things were getting deprecated. It looks like we marked in the docs that apt-key is deprecated and to ask folks to transition, but we haven't actually done hard deprecations in the codebase. We also still officially support quite a few older OS versions that do have apt-key.
Given that, I'm hesitant to recommend we do a hard-break of the functionality across all OS by doing a new major version release that removes apt-key.
Claude wanted to recommend a full
gpgrewrite, but I don't know that we need to go that far. That seems like a lot of code changes for minimal benefits.What I'm currently thinking:
apt-keyso we can give a real error with direction to use keyring instead, instead of the current method that just fails with the 'could not find a suitable provider' error.What do you think @bwitt ?
Deprecate apt_key and fail clearly when apt-key is unavailable
bwitt commentedon Nov 2, 2026
sure that sounds good:
apt::keytoojst-cyr commentedon Nov 2, 2026
@SugatD has started a new PR (#1337) that will close both this (#1306) and #1307 at the same time. It can also be used for #1272 as well to get Debian 13 tests passing as well since it had the same issue with
apt-keyDeprecate apt_key and fail clearly when apt-key is unavailable