charmcraft internal error! BaseConfigurationError: Failed to install apt-utils
Metadata
Current evaluation
Resolved through project configuration: the author added git to parts.charm.build-packages in charmcraft.yaml; no Charmcraft code fix was reported.
Resolution: closed not a bug
Reason: In the final comment on 2021-08-23, the author said adding parts.charm.build-packages: [git] solved the problem. No resolving PR or commit was cited, indicating a missing build dependency in the project configuration rather than a product-code defect.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Hi,
When using latest 1.2.1 `charmcraft pack` fails to run complaining of not being able to install apt-utils:
```
DEPRECATED: A charmcraft.yaml configuration file is now required.
See https://discourse.charmhub.io/t/4652#heading--dn02 for more information.
Packing charm 'gatekeeper-audit_ubuntu-20.04-amd64.charm'...
charmcraft internal error! BaseConfigurationError: Failed to install apt-utils.
* Command that failed: 'lxc --project charmcraft exec local:charmcraft-gatekeeper-audit-3287863-0-0-amd64 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin CHARMCRAFT_MANAGED_MODE=1 apt-get install -y apt-utils'
* Command exit code: 100
* Command output: b'Reading package lists...\nBuilding dependency tree...\nReading state information...\nPackage apt-utils is not available, but is referred to by another package.\nThis may mean that the package is missing, has been obsoleted, or\nis only available from another source\nHowever the following packages replace it:\n apt\n\n'
* Command standard error output: b"E: Package 'apt-utils' has no installation candidate\n" (full execution logs in /home/pjds/snap/charmcraft/common/charmcraft-log-7zrrx2cu)
```
Steps to reproduce:
1. Install charmcraft latest and tool chain, using `lxd init --auto`
2. run `charmcraft pack`
3. the build should fail with the above error
Notes:
Running a LXC container with ubuntu 18.04 or 20.04 appears to have the package installed automatically, I was not able to replicate the error in fresh containers outside of charmcraft.
Environment:
Ubuntu 20.04
Charmcraft 1.2.1
Thanks,
Peter
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed not a bug | Resolved through project configuration: the author added git to parts.charm.build-packages in charmcraft.yaml; no Charmcraft code fix was reported. | |
| stealth/space-bunny-alpha | — | closed not a bug | Charmcraft 1.2.1 LXD build failures (apt-utils unavailable, systemd-resolved, missing git) were a host/config problem, not a Charmcraft bug; reporter closed it after adding parts.charm.build-packages: [git] to charmcraft.yaml. | |
| stealth/space-bunny-alpha | — | closed not a bug | Resolved by configuration: the author added git to the charm's parts.charm.build-packages in charmcraft.yaml; no Charmcraft code change was cited. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved by adding missing build dependencies to charmcraft.yaml. The author confirmed that specifying parts.build-packages, such as git, fixed the LXC container setup failures for apt-utils and git during charmcraft pack. | |
| qwen/qwen3.6-35b-a3b | — | — | The author resolved the build failures by adding missing packages to their charmcraft.yaml configuration. The issue was closed as the errors stemmed from missing environment dependencies rather than a charmcraft bug. | |
| qwen/qwen3.6-35b-a3b | — | — | The author resolved the charmcraft pack failure by adding build-packages to charmcraft.yaml. The missing apt-utils and git dependencies were fixed through configuration rather than a code patch. Issue closed by the reporter. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved by the author, who added missing build dependencies to charmcraft.yaml. The report was closed without upstream code changes. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #605 Charmcraft fails to build due to lack of Git | charmcraft | closed | Resolved as a build-environment configuration issue: the reporter fixed the failure by adding git to parts.charm.build-packages in charmcraft.yaml. | |
| #498 charmcraft 1.2.1 (candidate): cannot pull python deps with git | charmcraft | closed | Reported that charmcraft 1.2.1 fails with "Cannot find command 'git'" when pulling Git-based Python deps. Maintainer facundobatista closed it as config: add git to build-packages (see Charm Discourse thread 4986); no code change. | |
| #490 pack fails with ERROR: Cannot find command 'git' | charmcraft | closed | Resolved as a missing build dependency: add git under parts.charm.build-packages in charmcraft.yaml; the maintainer provided this configuration before closing the issue. |