← Back to issue list

charmcraft internal error! BaseConfigurationError: Failed to install apt-utils

View original Github issue

Metadata

Project
charmcraft
Number
#502
Type
issue
State
closed
Author
VariableDeclared
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action:

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
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.
qwen3.6-35b-a3b-mtp-q6 Resolved by the author adding build-packages to charmcraft.yaml. The reported apt-utils and git failures stemmed from missing project dependencies in the LXC environment, not a charmcraft bug.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#507 charmcraft pack fails for apt-utils is not available charmcraft closed Closed as an environment conflict. Docker interfered with iptables, blocking apt-utils in LXD. The author resolved it by uninstalling Docker, and a maintainer confirmed the networking issue with a workaround. No code changes were made.
73%
#490 pack fails with ERROR: Cannot find command 'git' charmcraft closed Resolved by adding parts: charm: build-packages: [git] to charmcraft.yaml to install required dependencies. The issue was closed after confirming this configuration addresses the missing git error on fresh installs.
73%
#1104 charmcraft pack on Ubuntu 23.04 (Lunar) fails. charmcraft closed Charmcraft pack failed on Ubuntu 23.04 due to unavailable build environments. PR #1130 addressed the issue but was blocked by an external cloud-images bug. The issue was closed pending upstream resolution.
70%