Does conda's local repodata TTL let `conda search` miss newly published packages?
0 reputation · 08 Feb 2026, 11:46 UTC
0 reputation · 08 Feb 2026, 11:46 UTC
Conda stores per-channel repodata and a parsed index under the package cache directory, so both conda search and the solver may read a local snapshot rather than the live channel. The local_repodata_ttl setting defines how long that snapshot is considered fresh; entries younger than the TTL are reused instead of refetched. The documented way to force a refresh is deleting the index cache, but the precise revalidation contract varies by conda version and channel configuration.
Because defaults for compression, index caching, and the solver have shifted across releases—and Anaconda's bundled conda can differ from conda-forge builds—the exact stale window is not universal. It remains unclear whether conda performs HTTP validator revalidation inside the TTL window or strictly trusts local age, which affects whether a package published minutes ago can be absent from search results until the cache ages out or is cleaned.
Which conda versions enforce the TTL without guaranteed ETag or Last-Modified revalidation, and does that mean conda search can omit a package that already exists upstream? When is it appropriate to shorten local_repodata_ttl versus cleaning the index cache for a one-off query? How should the active TTL and cache location be verified for a specific installation before treating a missing version as authoritative?
32775 reputation · 08 Feb 2026, 14:36 UTC
Yes. When a channel's cached repodata is younger than local_repodata_ttl, conda search and the solver can read that local snapshot instead of fetching live metadata. A package published after the snapshot was written can therefore be absent from results until the cache expires or is cleaned.
Confirmed: The TTL is a freshness age for local index files. While a cached file is inside that window, conda reuses it rather than refetching the channel index.
Uncertain and version-dependent: Whether conda performs HTTP conditional revalidation (ETag or Last-Modified) inside the TTL window depends on the conda release and build. Some versions strictly trust local file age and skip network checks. Because defaults for compression, index caching, and solver behavior have shifted across releases—and Anaconda's bundled conda can differ from conda-forge or Miniforge builds—the exact stale window is not universal.
conda --versionconda config --show local_repodata_ttl and conda config --show channelsconda infoconda clean -iconda search <package> (optionally with --json)If the missing version appears only after cleaning, the local TTL was the cause.
For a single query, conda clean -i is appropriate. For repeated queries against fast-moving channels, temporarily lowering local_repodata_ttl (for example, to 1) is more practical than cleaning repeatedly. Setting TTL to 0 disables the age check but increases network load and may not bypass every local caching layer.
Because revalidation semantics and defaults differ by distribution and release, the exact conda version and channel URL would narrow the stale window and confirm whether HTTP revalidation is attempted inside the TTL.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.