KIWI-ng 10.2.33 + Ubuntu 24.04 LTS: base-files “split /usr” error during apt-based bootstrap (merged-/usr confirmed)

12 views
Skip to first unread message

Matt Tolle

unread,
Oct 10, 2025, 2:52:23 PM (9 days ago) Oct 10
to kiwi

Environment:

  • KIWI-ng 10.2.33
  • Ubuntu 24.04 LTS (noble) as both build host and image target
  • Host and target root both use merged-/usr layout (/bin, /sbin, /lib64 are symlinks to /usr/bin, /usr/sbin, /usr/lib64)
  • Building OEM image for GCP, using apt-based bootstrap (not debootstrap)

Problem:
During kiwi-ng system prepare, the build fails when installing the base-files package with the following error:

****************************************************************************** * * The base-files package cannot be installed because this system has a * split /usr. * * Please install the usrmerge package to convert this system to merged-/usr. * * For more information please read https://wiki.debian.org/UsrMerge. * ******************************************************************************
  • The error is emitted by the base-files preinst script during apt-based bootstrap.
  • Both the build host and the target root have the correct merged-/usr symlinks.
  • No /tmp/kiwi-debootstrap.log is created, and /usr/sbin/debootstrap is not invoked (KIWI uses apt/dpkg directly).

What I’ve checked/tried:

  • Verified symlinks inside both host and /app/build/image-root: ls -ld /bin /sbin /lib64 ls -ld /app/build/image-root/bin /app/build/image-root/sbin /app/build/image-root/lib64 All are symlinks to /usr/* as expected.
  • Confirmed that KIWI is bind-mounting /proc, /sys, /dev into the target root during build.
  • Manually chrooted into the target root; attempted to extract and run the base-files preinst script, but the .deb file is not present inside the chroot after KIWI runs.
  • Build host and target root are both Ubuntu 24.04, x86_64, and up-to-date.
  • Did not add usrmerge to the image (it is obsolete and not available in 24.04).

Questions:

  • Is this a known issue with KIWI-ng’s apt-based bootstrap for Ubuntu 24.04?
  • Is there a workaround to prevent the base-files preinst script from misdetecting the layout?
  • Is there a recommended way to debug the apt/dpkg environment inside KIWI during package installation?
  • Should I be using a different bootstrap method (e.g., debootstrap) for Ubuntu 24.04 images?
  • Is there a specific version of base-files that is known to work with KIWI-ng on 24.04?
Here is my very basic config.xml: 

<?xml version="1.0" encoding="utf-8"?>
<image schemaversion="8.0" name="ubuntu24-oem">
  <description type="system">
    <author>Enterprise Build</author>
    <contact>ad...@example.com</contact>
    <specification>Ubuntu 24.04 OEM image for GCP (dracut + LVM)</specification>
  </description>

  <preferences>
    <version>24.04.0</version>
    <packagemanager>apt</packagemanager>
    <type image="oem" filesystem="ext4" firmware="uefi" initrd_system="dracut" format="gce">
      <bootloader name="grub2"/>
      <size unit="G">10</size>
      <systemdisk name="rootvg">
        <volume name="@root" size="4G"/>
        <volume name="lv_var" size="1G" mountpoint="var"/>
        <volume name="lv_tmp" size="1G" mountpoint="tmp"/>
        <volume name="lv_home" size="1G" mountpoint="home"/>
        <volume name="lv_opt" size="1G" mountpoint="opt"/>
      </systemdisk>
    </type>
  </preferences>

  <repository sourcetype="baseurl" priority="1" distribution="noble" components="main restricted universe multiverse">
    <source path="http://archive.ubuntu.com/ubuntu"/>
  </repository>
  <repository sourcetype="baseurl" priority="2" distribution="noble-updates" components="main restricted universe multiverse">
    <source path="http://archive.ubuntu.com/ubuntu"/>
  </repository>
  <repository sourcetype="baseurl" priority="3" distribution="noble-security" components="main restricted universe multiverse">
    <source path="http://security.ubuntu.com/ubuntu"/>
  </repository>

  <packages type="bootstrap">
    <package name="apt"/>
    <package name="ubuntu-keyring"/>
    <package name="ca-certificates"/>
    <package name="gnupg"/>
    <package name="systemd-sysv"/>
    <package name="initramfs-tools"/>
    <package name="locales"/>
  </packages>

  <packages type="image">
    <package name="ubuntu-minimal"/>
    <package name="linux-image-generic"/>
    <package name="grub-pc"/>
    <package name="lvm2"/>
    <package name="dracut"/>
    <package name="kiwi-dracut-oem-repart"/>
    <package name="cloud-init"/>
    <package name="netplan.io"/>
  </packages>
</image>

Any help or insight would be greatly appreciated!
If more logs are needed, I can provide them.

Marcus Schäfer

unread,
Oct 13, 2025, 9:31:03 AM (7 days ago) Oct 13
to kiwi-...@googlegroups.com
Hi,

> base-files package with the following error:
> ***********************************************************************
> ******* * * The base-files package cannot be installed because this
> system has a * split /usr. * * Please install the usrmerge package to
> convert this system to merged-/usr. * * For more information please
> read https://wiki.debian.org/UsrMerge. *
> ***********************************************************************
> *******

Interesting. I was able to reproduce your issue. The problem is
the collection of packages that you wanted to be installed as
part of the bootstrap procedure. For some reason this confused
apt in the way it is called for the bootstrap phase.

On a general note, try to place as less as possible packages to
the bootstrap. I usually just go with the ca-certificates package
as all the rest comes from the boostrap implementation we have
for Debian based systems.

For simplicity I added repository_gpgcheck="false" in my testing.
You can remove that again if you have the repo keys available.

So I changed your image bootstrap a bit and moved most if it to
the image section (to be installed as chrooted standard apt install)
That way the image could be built.

Please also take into consideration to look at our integration test
images:

https://github.com/OSInside/kiwi/blob/main/build-tests/x86/ubuntu/test-image-live-disk/appliance.kiwi

Yours was also missing all the grub stuff

Hope this now works for you. See the attachment.

I build tested it with

kiwi-ng system boxbuild --box ubuntu -- --description __Matt/ --target-dir /tmp/mytest/

Best regards,
Marcus
--
Public Key available via: https://keybase.io/marcus_schaefer/key.asc
keybase search marcus_schaefer
config.xml
signature.asc

Matt Tolle

unread,
Oct 14, 2025, 10:55:40 AM (5 days ago) Oct 14
to kiwi
Thank you very much. That was exactly the information I needed. 

-Matt

Reply all
Reply to author
Forward
0 new messages