← Back to issue list

Base images store out-of-date apt package caches

View original Github issue

Metadata

Project
snapcraft
Number
#5879
Type
issue
State
open
Author
lengau
Labels
Created
2025-11-19 16:48:37+00:00
Updated
2025-11-19 16:48:37+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description This is pretty hard to reproduce and not specifically a bug in snapcraft (I put it here to keep it logged somewhere, as I'm unsure where the fix needs to go). @bepri encountered this today when trying to update a snapcraft.yaml file What happened is that his LXD base image used for snapcraft was created before noble-updates got a cargo-1.85 package, so adding it as a build-package caused craft-parts to fail when trying to install it (because there was no package with that name). Possible fixes: 0. Asynchronously run `apt update` on boot. 1. Always update before installing build-packages (up side: gets the latest packages. Down side: very slow) 2. If there are errors when installing build-packages, run update and try again before failing. This is also the sort of thing that could be worked around by a user if we implemented [a purge command](https://github.com/canonical/charmcraft/issues/1042) for all apps. That's not a fix, but it makes these types of bugs less annoying for users since they don't have to manually mess with the lxd project ### To Reproduce 1. Create a snapcraft.yaml file that adds your own PPA or similar. 2. Run `snapcraft pack` 3. Add a new package (that's not in the Ubuntu repos) to that PPA 4. Add that package to the `build-packages` for a part Expected behaviour: It installs that build package Actual behaviour: It complains that the package does not exist ### Environment n/a ### snapcraft.yaml ```yaml n/a ``` ### Relevant log output ```shell n/a ``` ### Additional context _No response_

Evaluation history

No evaluation history available.