Skip to content

fix(testing): don't wipe /var/cache/apt entirely on ALT Linux images - #136

Merged
twangboy merged 1 commit into
saltstack:mainfrom
twangboy:fix_altlinux_apt_cache
Sep 2, 2026
Merged

twangboy merged 1 commit into
saltstack:mainfrom
twangboy:fix_altlinux_apt_cache

Conversation

@twangboy

@twangboy twangboy commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

The final cleanup step in custom/testing/altlinux-10.Dockerfile and custom/testing/altlinux-11.Dockerfile runs:

```
apt-get clean
rm -rf /var/cache/apt
```

Unlike Debian/Ubuntu's apt, which keeps its package lists in /var/lib/apt/lists and only caches downloaded archives under /var/cache/apt, ALT Linux's apt-get (apt-rpm) keeps its package lists under /var/cache/apt itself. Wiping the whole tree removes that state, so any apt-get update run in a container started from this image fails immediately (no network attempt, just a local error).

This was breaking salt-bootstrap CI for ALT Linux (see saltstack/salt-bootstrap#2125), where install_alt_linux_onedir_deps()'s apt-get update failed right away with no useful error in the trace.

Fix: only clear the archive cache (rm -rf /var/cache/apt/archives/*), matching the pattern every Debian/Ubuntu testing Dockerfile in this repo already uses.

What issues does this PR fix or reference?

Unblocks saltstack/salt-bootstrap#2125.

ALT's apt-get (apt-rpm) keeps its package lists under /var/cache/apt
itself, unlike Debian/Ubuntu's apt which keeps lists in
/var/lib/apt/lists and only caches downloaded archives under
/var/cache/apt. The final 'rm -rf /var/cache/apt' cleanup step
deleted that state, so every 'apt-get update' run against containers
built from this image failed immediately. Only clear the archive
cache instead, matching the pattern already used by every
Debian/Ubuntu testing Dockerfile in this repo.
@twangboy
twangboy merged commit 74eb4f0 into saltstack:main Sep 2, 2026
40 checks passed
twangboy added a commit that referenced this pull request Sep 3, 2026
…mages

The previous fix (#136) narrowed the final cache cleanup from
'rm -rf /var/cache/apt' to 'rm -rf /var/cache/apt/archives/*', but
that glob also removes the archives/partial subdirectory itself.
ALT's apt-get (apt-rpm) doesn't recreate it on its own, so every
apt-get update run against containers built from this image still
failed:

  E: Archive directory /var/cache/apt/archives/partial is missing.
  E: Unable to lock the list directory

Recreate the empty directory after cleaning.
@twangboy twangboy self-assigned this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant