repo: raise error when populating the apt cache directory fails
Metadata
Current evaluation
Merged. Adds a helpful error when copying /etc/apt to the cache directory fails, resolving CRAFT-1421. Handles Ubuntu Pro and destructive mode edge cases without root privileges. Approved by two reviewers and passed CI.
Suggested action: —
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [X] Have you successfully run `make lint`?
- [X] Have you successfully run `pytest tests/unit`?
-----
If the contents of `/etc/apt` cannot be copied to the cache directory, snapcraft will now produce a helpful error.
This can occur on a system where Ubuntu Pro is enabled, snapcraft is run in destructive mode, and snapcraft is not being run with sudo nor as root.
(CRAFT-1421)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Adds a helpful error when copying /etc/apt to the cache directory fails, resolving CRAFT-1421. Handles Ubuntu Pro and destructive mode edge cases without root privileges. Approved by two reviewers and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. Snapcraft now raises a clear error when copying /etc/apt to the cache directory fails, resolving CRAFT-1421 and improving error reporting in Ubuntu Pro destructive mode without root privileges. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. Adds explicit error handling when /etc/apt contents fail to copy to the apt cache directory. Provides a clear error message for destructive mode runs with Ubuntu Pro lacking root privileges. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1194 fix: correct file permissions for the apt cache | craft-parts | merged | Merged to correct apt cache file permissions, resolving the not owned by _apt error during package staging in managed builds. Approved by three reviewers with all CI checks passing. Requires craft-providers PR 813. | |
| #3585 repo: use host state for apt cache (CRAFT-488) | snapcraft | merged | Merged into master. Replaces split stage cache with host apt cache by setting state directory to /var/lib/apt. Approved by two reviewers, passed CI, and achieved 100% coverage. Resolves CRAFT-488. | |
| #2079 repo: catch error updating the package cache | snapcraft | merged | Merged. Catches apt package cache update errors like hash mismatches and host resolution failures. Fixes #2029, #2030, and LP: #1747715 by handling exceptions, clearing the index on hash failures, and allowing Snapcraft to proceed. Includes test updates. | |
| #43 packages: add support to apt cache operations | craft-parts | merged | Merged PR adding apt cache operations for package retrieval. Approved by two reviewers and passed CI. Follows snapcraft standards and is planned for future migration to a separate project. |