Failed to build Debian due to missing Package in bootstrap phase

23 views
Skip to first unread message

Sven Wölfel

unread,
Jan 10, 2025, 5:05:47 AMJan 10
to kiwi
Hello,
I'm trying to build a Debian Bookworm Image based on the description from the official kiwi-ng descriptions repository with the kiwi boxbuild extension.

But whenever I try to build I get the error:
[ ERROR   ]: 09:40:23 | KiwiDebianBootstrapError: KiwiCommandError: chroot: stderr: dpkg-query: error: package 'ucf' is not installed

Despite the fact that I can see in the log that it is being installed.
I even tried to put the package "ucf" in the debootstrap package section but without any success.
Is there something else I can try? 

Removing the "grub2" package which has ucf as a requirement opens a whole different can of worms.

Logfile and config are attached.

Any suggestion is welcome.

Regards

Sven

result.log
config.xml

Marcus Schäfer

unread,
Jan 10, 2025, 7:17:35 AMJan 10
to kiwi-...@googlegroups.com
Hi Sven,

> [ ERROR ]: 09:40:23 | KiwiDebianBootstrapError: KiwiCommandError:
> chroot: stderr: dpkg-query: error: package 'ucf' is not installed

I was looking at the log file and here is what I think.
grub2 has a requirement on ucf and it is fetched as part of the
bootstrap process:

[ DEBUG ]: 09:40:16 | EXEC: [apt-get -q -c /result/build/image-root/kiwi_apt.conf -y --no-install-recommends install -oDebug::pkgDPkgPm=1 -oDPkg::Pre-Install-Pkgs::=cat >/var/tmp/kiwi_debs_cwb8gjf0 ?essential apt grub2 usrmerge]
...
The following additional packages will be installed:
... ucf ...
Get:92 http://apt-cache.internal.de:3142/debian_lff bookworm/main amd64 ucf all 3.0043+nmu1 [55.2 kB]

After the packages got downloaded we manually "install" them in the bootstrap
phase. ucf is part of that process

[ DEBUG ]: 09:40:20 | EXEC: [bash -c dpkg-deb --fsys-tarfile /var/cache/kiwi/apt-get/archives/ucf_3.0043+nmu1_all.deb | tar -C /result/build/image-root -x]

After this action ucf exists in the bootstrap root. At the end of all
this bootstrap unpacking we call the scripts of each package.

[ DEBUG ]: 09:40:23 | Running pre/post scripts for: ucf_3.0043+nmu1_all.deb
...
[ DEBUG ]: 09:40:23 | Running pre/post scripts for: grub-pc_2.06-13+deb12u1_amd64.deb
[ DEBUG ]: 09:40:23 | EXEC: [chroot /result/build/image-root /kiwi_debpost.yr1ui2u9/grub-pc_2.06-13+deb12u1_amd64.deb/postinst configure]
[ DEBUG ]: 09:40:23 | EXEC: Failed with stderr: dpkg-query: error: package 'ucf' is not installed

And here is the issue.

To me it looks like the grub2 package scripts checks via dpkg-query if ucf is
installed. At this point in the bootstrap phase the package database from an
apt/dpkg perspective is incomplete due to the way the bootstrap implementation
called apt-get and dpkg-deb --fsys-tarfile. So the tool itself, ucf would
be there and works but when you ask the package database it probably says
it's not installed. If the grub2 package would check for the ucf binary
instead of asking the package database you would probably not having this
issue.

As you need to build up a proper bootstrap root such that you can use
apt in the normal way we get a clean dpkg state only after the bootstrap
phase is done and kiwi can call apt and update the cache and install
the rest in the normal way. During bootstrap phase I assume any package
that has script code reading data from the package database has an issue.

> Is there something else I can try?

You should not put grub2 to the bootstrap phase. Install it later in
the image phase. Actually I always try to keep the boostrap empty
when building Debian based systems such that the bootstrap action
is limited to the minial required packages resolved by apt.

> Removing the "grub2" package which has ucf as a requirement opens a
> whole different can of worms.

If you have moved it to the type="image" section and you run into
other issues just send the new log file and I take a look

Regards,
Marcus
--
Public Key available via: https://keybase.io/marcus_schaefer/key.asc
keybase search marcus_schaefer
-------------------------------------------------------
Marcus Schäfer Brunnenweg 18
Tel: +49 7562 905437 D-88260 Argenbühl
Germany
-------------------------------------------------------
signature.asc

Marcus Schäfer

unread,
Jan 10, 2025, 8:45:50 AMJan 10
to kiwi-...@googlegroups.com
Hi Sven,

I reproduced your issue with one of the community images
for bookworm and fixed it.

kiwi-ng system boxbuild --box ubuntu -- --description /home/ms/Project/kiwi-descriptions/debian/x86_64/debian-bookworm/ --target-dir /tmp/mytest/

worked for me from the description in:

https://github.com/OSInside/kiwi-descriptions/tree/main/debian/x86_64/debian-bookworm

Hope this helps
signature.asc

Sven Woelfel

unread,
Jan 10, 2025, 11:48:41 AMJan 10
to kiwi-...@googlegroups.com
Thank you very much!

I wouldn't have found that issue......

I will test it on monday and report back to you!


Regards

Sven

Sven Woelfel

unread,
Jan 13, 2025, 7:53:33 AMJan 13
to kiwi-...@googlegroups.com
Hi,

I can confirm that it also works with the universal box.

The error with grub-pc and grub-efi was the can of worms I mentioned in
my previous message.

Thanks again for the updated description.


Regards

Sven

On 10.01.25 14:45, Marcus Schäfer wrote:
Reply all
Reply to author
Forward
0 new messages