Article View: linux.debian.bugs.dist
Article #6497Bug#1154510: mmdebstrap fails to build images for Ubuntu xenial and trusty
From: Benjamin Drung
Date: Fri, 27 Nov 2026 23:10
Date: Fri, 27 Nov 2026 23:10
390 lines
18111 bytes
18111 bytes
On Fri, 2026-11-27 at 23:04 +0100, Johannes Schauer Marin Rodrigues
wrote:
> > > When I run the testsuite I saw that your commit "Also add updates pocket when a
> > > mirror is specified" introduced a regression in the tests dist-using-codename
> > > and check-against-debootstrap-dist. You can reproduce the problem like this:
> > >
> > > mmdebstrap trixie /dev/null http://deb.debian.org/debian
> > >
> > > Even though you specified a stable release name, you *also* specified a mirror
> > > which means that you turned off the mechanism which automatically picks the
> > > repositories for a stable release.With your change, the resulting chroot will
> > > contain the trixie-updates and trixie-security repositories in sources.list.
> >
> > Yes. This is an intentional change. I changed this commit to reflect
> > that in the documentation.
>
> I see this in this commit:
>
> > Also add updates and security mirrors when a URI is specified
> >
> > `get_sourceslist_by_suite` will add updates and security mirrors when no
> > URI is specified on the command line, but it will not be added when a
> > URI is specified. This is inconsistent and probably not what a user
> > wants by default.
>
> This is a breaking change. What motivation do you have for breaking the
> interface? Ideally, I'd only break the interface if there is a reason like "if
> we don't break it, then we cannot have feature XY" or "we don't break it, we
> actually fix a bug". I don't see either of that in this case. Can you
> elaborate?
>
> For me it's logical that a mirror to "security.debian.org" is *not* specified
> when the user explicitly says which mirror they want the packages to come from.
> Did you only change it because the existing behaviour felt illogical to you or
> because the Ubuntu support you wanted to implement cannot work otherwise?
>
I was surprised when I noticed that specifying a mirror disabled the
additional repositories and the security mirror. So yes, this behavior
felt illogical to me.
IIRC when I do an installation of Debian/Ubuntu I might be able to pick
a mirror, but the security mirror will be added anyway. I would expect
mmdebstrap to behave similar to it.
The logical behavior for me is: If I provide a $foo.list or $foo.sources
file, I will get exactly this for my apt sources. Otherwise I get the
whole repository defaults with the default mirror or the mirror that I
specify.
Currently there is no way to just replace the default mirror with a
custom one. Since we do not have something like
http://deb.debian.org/debian for Ubuntu, using $CC.archive.ubuntu.com as
mirror is common on Ubuntu.
> > I tried to run the test suite, but make_mirror.sh failed on Ubuntu:
> >
> > ```
> > $ ./make_mirror.sh
> > I: Starting caching proxy with:
> > I: * old cache: ./shared/cache.B
> > I: * new cache: ./shared/cache.A
> > starting caching proxy for shared/cache.A
> > proxy download: http://deb.debian.org/debian/dists/unstable/InRelease
> > proxy cached: http://deb.debian.org/debian/dists/unstable/InRelease
> > creating mirror for oldstable
> > contents of /etc/apt/sources.list:
> > deb [arch=amd64] http://deb.debian.org/debian oldstable main
> > proxy download: http://deb.debian.org/debian/dists/oldstable/InRelease
> > Holen:1 http://deb.debian.org/debian oldstable InRelease [151 kB]
> > Fehl:1 http://deb.debian.org/debian oldstable InRelease
> > Die folgenden Signaturen konnten nicht überprüft werden, weil ihr öffentlicher Schlüssel nicht verfügbar ist: NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY 78DBA3BC47EF2265 NO_PUBKEY F8D2585B8783D481
> > Paketlisten werden gelesen… Fertig
> > W: http://deb.debian.org/debian/dists/oldstable/InRelease: Loading /etc/apt/trusted.gpg from deprecated option Dir::Etc::Trusted
> > W: OpenPGP-Signaturüberprüfung fehlgeschlagen: http://deb.debian.org/debian oldstable InRelease: Die folgenden Signaturen konnten nicht überprüft werden, weil ihr öffentlicher Schlüssel nicht verfügbar ist: NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY 78DBA3BC47EF2265 NO_PUBKEY F8D2585B8783D481
> > E: Das Depot »http://deb.debian.org/debian oldstable InRelease« ist nicht signiert.
> > N: Eine Aktualisierung von solch einem Depot kann nicht auf eine sichere Art durchgeführt werden, daher ist es standardmäßig deaktiviert.
> > N: Weitere Details zur Erzeugung von Paketdepots sowie zu deren Benutzerkonfiguration finden Sie in der Handbuchseite apt-secure(8).
> > N: Einige Quellen können modernisiert werden. Führen Sie dafür »apt modernize-sources« aus.
> > running cleanupapt
> > does not exist: ./shared/cache.A/apt/var/cache/apt/archives/*.deb
> > does not exist: ./shared/cache.A/apt/var/cache/apt/archives/partial/*.deb
> > rmdir: failed to remove './shared/cache.A/apt/var/lib/apt/lists/partial': Directory not empty
> > ```
>
> I never ran make_mirror.sh on a Debian derivative. The above sounds like you
> don't have debian-archive-keyring or similar installed?
> >
I have debian-archive-keyring 2025.1ubuntu1 installed.
> > > my $base_suite = $options->{suite} =~ s/-.*//sr;
> > >
> > > This makes the minus special in the suite name. This needs to be documented.
> > >
> > > The idea of making the minus special to create a mapping got already mentioned
> > > in #1140618 and it's an idea which we already implemented in sbuild using the
> > > default distro-mange option:
> > >
> > > 'UNSHARE_MMDEBSTRAP_DISTRO_MANGLE' => {
> > > TYPE => 'ARRAY:STRING',
> > > VARNAME => 'unshare_mmdebstrap_distro_mangle',
> > > GROUP => 'Chroot options (unshare)',
> > > DEFAULT => [
> > > qr/^(experimental|rc-buggy|unreleased|UNRELEASED.*)$/ =>
> > > 'unstable',
> > > -(security|backports|backports-sloppy|proposed|proposed-updates|updates)$/
> > > => '$1',
> > > ],
> > >
> > > In #1140618 you also point out that you are thinking about this change in
> > > mmdebstrap in connection with its use in sbuild. That was exactly my line of
> > > thought as well. The distro-mange option of sbuild was an experiment to see if
> > > it's something pleasant to use. As I pointed out elsewhere, I would like the
> > > final solution to involve machine readable data. But since you already
> > > submitted code which makes that work for ubuntu I think this can be a stepping
> > > stone towards the final solution.
> > >
> > > I see that you added the default components to the documentation. This should
> > > happen but it should also include other derivatives. Maybe via a table?
> >
> > The special handling of minus in mmdebstrap makes the
> > UNSHARE_MMDEBSTRAP_DISTRO_MANGLE and UNSHARE_MMDEBSTRAP_EXTRA_ARGS
> > setting obsolete. The UNSHARE_MMDEBSTRAP_EXTRA_ARGS was too broad and
> > added the Debian mirror for Ubuntu when using resolute-updates for
> > example.
>
> I don't want to remove UNSHARE_MMDEBSTRAP_DISTRO_MANGLE nor
> UNSHARE_MMDEBSTRAP_EXTRA_ARGS from sbuild because I think they still allow a
> flexible way to cook up something very custom. But yes, the plan is to move a
> lot of automatism to mmdebstrap so that users of sbuild only have to resort to
> these settings if their use-case is somewhat special.
>
I don't propose to remove those setting, but the mmdebstrap change would
trim down the defaults to:
UNSHARE_MMDEBSTRAP_DISTRO_MANGLE => [qr/^(unreleased|UNRELEASED.*)$/ => 'unstable']
UNSHARE_MMDEBSTRAP_EXTRA_ARGS => []
> > After my experiment, I think following approach is the best way forward:
> > Get this change into mmdebstrap and carve out functions that could be
> > moved to distro-info. Then mmdebstrap could use those functions from
> > libdistro-info-perl. Currently mmdebstrap reads the data from distro-
> > info-data directly. I don't know how much code logic could be avoided
> > when just continue doing so for mirrors and suites.
>
> Your plan involves coordination with distro-info maintainers. I actually wanted
> to first prototype something which fulfills the needs of mmdebstrap (I'm not
> quite sure yet how that would look like myself) and once that works, I can
> propose how to best store this information in a machine-readable format to
> distro-info. Once distro-info carries it, I can switch mmdebstrap to that.
>
FYI: I am the author/maintainer of distro-info.
> > I pushed the updated code to
> > https://salsa.debian.org/debian/mmdebstrap/-/commits/ubuntu-support?ref_type=heads
> > The commits are ready for being merged except for the top two ones that
> > have TODO entries in their commit messages.
>
> That looks mostly good, thank you! I'd like to clear up the behaviour change
> from above and then I'll look at your branch in more detail and give you
> feedback in case I find anything problematic. But I think it's good to merge
> these changes before I start working on the declarative distro-info format.
> Indeed your work gives me a better idea about what a derivative distro might
> need, thank you!
>
> > On Fri, 2026-11-27 at 10:38 +0100, Johannes Schauer Marin Rodrigues wrote:
> > > thank you for these patches! I see you updated
> > > 0001-hooks-jessie-or-older-also-install-maw. I locally rewrote history to
> > > instead contain the patch from this mail. Thank you for being verbose in your
> > > commit message.
> >
> > I rebased my ubuntu-support branch and pushed it.
>
> Why the change in 'refactor: call get_suite_by_vendor earlier'?
> >
Because function like get_vendor_by_suite will need suite_by_vendor
earlier.
> > > In your hooks, could you put your name and copyright in form of a SPDX header
> > > at the top?
> >
> > Yes. Done and pushed in the ubuntu-support branch.
>
> Perfect, thank you!
>
> > > That being said, old distros still require a lot of workarounds and most of
> > > them can no longer be fixed. This is what the jessie-or-older hook is for. It
> > > contains all the hacks which used to be necessary and which debootstrap worked
> > > around by manually selecting installation order and some such. Since
> > > debootstrap existed we were complacent and there was no pressure to fix these
> > > things in the respective packages because the bootstrapping tool took care of
> > > papering over them. This bugged me, so I filed patches and for modern
> > > derivatives, the jessie-or-older hook is no longer required.
> > >
> > > Since I want to keep it that way, I would be very much against adding any
> > > command line options which enable or disable distro-specific hacks. Those
> > > options do then have to be carried forever. I want to go the opposite
> > > direction: fix packages so that hacks never have to be used again by a
> > > bootstrapping tool.
> > >
> > > For old distros: that's what the hooks are for. They allow you to implement any
> > > hack you desire (as you now can confirm).
> >
> > We know what quirks are needed for old distros and we know that those
> > old distros won't be updated for that any more. My idea was that
> > mmdebstrap could enable those hooks by default when it detects an old
> > distro that needs it.
>
> That assumption would probably work for Ubuntu, yes. But there are rolling
> release distros for which this approach would not work. Even Debian has testing
> and stable which are technically "rolling releases". If you look at the
> mechanisms used in maybe-jessie-or-older you will see that it does *not* check
> the suite name at all but looks at the package versions and features.
>
> Many people value how fast mmdebstrap is. I'm hesitant to make such kind of
> "older than a decade" release detection logic by default because of that. I'm
> tending towards recommending that those who use mmdebstrap in a way where they
> often have to do that, then they can add the --hook-dir they need. Another
> reason against making the check the default is that I would estimate that the
> vast majority of mmdebstrap (or debootstrap) users do use it together with
> distros younger than five years and things should work out-of-the-box for
> those.
> >
I agree for Debian jessie, but Ubuntu 14.04 still gets support. So there
are users (like me) who want to build for those old releases.
Making mmdebstrap support old releases shouldn't be expensive. The code
would look something like (plus documenting it in the man page):
# Quirks for old release before 2017
sub get_default_hooks_by_suite {
my $suite = shift;
my $variant = shift;
my $mode = shift;
if (any { $_ eq $suite } keys ('jessie', 'wheezy', ...)) {
return ('jessie-or-older');
} elsif ($suite eq 'xenial') {
if ($variant eq 'standard' && $mode ne 'root') {
return ('xenial', 'skip-makedev');
}
return ('xenial');
} elsif (any { $_ eq $suite } keys ('trusty', 'precise', ...)) {
if ($variant eq 'standard' && $mode ne 'root') {
return ('jessie-or-older', 'skip-makedev');
}
return ('jessie-or-older');
}
return ();
}
Would you be open to such kind of change?
> > > About auto-adding those, did you have a look at the maybe-jessie-or-older hook?
> > > That one implements the auto-add behaviour that you are asking for. If you
> > > don't know what distro you are bootstrapping and if you want the hacks for old
> > > distros to automatically be applied if your distro is too old, then the
> > > maybe-jessie-or-older hook will do the auto-detection and run the
> > > jessie-or-older hooks only if necessary.
> >
> > This would work, but clutter the output for newer distros that do not
> > need this hook.
>
> Yes. That would be another reason against enabling these hooks by default.
>
> > > Also, would you prefer to keep the existing skip-makedev and xenial hooks which
> > > you proposed or would you rather write a hook called ubuntu which then does the
> > > auto-detection of which ubuntu-release is currently being bootstrapped and then
> > > does the right thing depending on the ubuntu version?
> > >
> > > Then you could use --hook-dir=./hooks/ubuntu for both trusty and xenial without
> > > having to remember which one of them needed the skip-makedev hook for example.
> >
> > Keeping the existing skip-makedev and xenial hooks make sense, since
> > those are the equivalent to the jessie-or-older hook. We could add a
> > maybe-xenial-or-older hook that does the equivalent to maybe-jessie-or-
> > older. Then users can use:
> >
> > mmdebstrap $debian-codename --hook-dir=./hooks/maybe-jessie-or-older
> > mmdebstrap $ubuntu-codename --hook-dir=./hooks/maybe-xenial-or-older
> >
> > Or have one common maybe-old-distro hook. So that you could use the same
> > parameters.
> >
> > Then sbuild should default to add this hook to support building on old
> > releases by default.
>
> Okay, you implement it and you know ubuntu better than I, so I will leave the
> naming of this up to you.
The drawback of having such a maybe-old-distro hook would that it
clutters the output even for recent releases.
--
Benjamin Drung
Debian & Ubuntu Developer
Technical Details
Message-ID:
<O4deN-eyOS-7@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<O1iaZ-cXIu-1@gated-at.bofh.it> <O1p2N-d1rv-3@gated-at.bofh.it> <O30Wl-dTPs-11@gated-at.bofh.it> <O40hz-erfP-1@gated-at.bofh.it> <O1iaZ-cXIu-1@gated-at.bofh.it> <O46ZH-euJJ-5@gated-at.bofh.it> <O4ciJ-eyj0-27@gated-at.bofh.it> <O1iaZ-cXIu-1@gated-at.bofh.it> <O4ciJ-eyj0-27@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!news.tcpreset.net!newsfeed.bofh.team!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Benjamin Drung <bdrung@debian.org> Newsgroups: linux.debian.bugs.dist Subject: Bug#1154510: mmdebstrap fails to build images for Ubuntu xenial and trusty Date: Sat, 28 Nov 2026 00:10:01 +0100 Message-ID: <O4deN-eyOS-7@gated-at.bofh.it> References: <O1iaZ-cXIu-1@gated-at.bofh.it> <O1p2N-d1rv-3@gated-at.bofh.it> <O30Wl-dTPs-11@gated-at.bofh.it> <O40hz-erfP-1@gated-at.bofh.it> <O1iaZ-cXIu-1@gated-at.bofh.it> <O46ZH-euJJ-5@gated-at.bofh.it> <O4ciJ-eyj0-27@gated-at.bofh.it> <O1iaZ-cXIu-1@gated-at.bofh.it> <O4ciJ-eyj0-27@gated-at.bofh.it> X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Fri Nov 27 23:09:09 2026 Old-Return-Path: <debbugs@buxtehude.debian.org> X-Spam-Flag: NO X-Spam-Score: -1.7 Reply-To: Benjamin Drung <bdrung@debian.org>, 1154510@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: josch@debian.org X-Debian-Pr-Message: followup 1154510 X-Debian-Pr-Package: mmdebstrap X-Debian-Pr-Source: mmdebstrap Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-9 MIME-Version: 1.0 X-Debian-User: bdrung X-Debian-Message: from BTS X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2005485 List-ID: <debian-bugs-dist.lists.debian.org> List-URL: <https://lists.debian.org/debian-bugs-dist/> Approved: robomod@news.nic.it Lines: 390 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sat, 28 Nov 2026 00:07:35 +0100 X-Original-Message-ID: <5513a1681f96adfb4c10eb5311fcbccf4d7f5b72.camel@debian.org> X-Original-References: <179512456377.1844508.10007620892073787783.reportbug@deep-thought> <179515098240.2951.3635647472516703784@localhost> <91600a9f37efc9aaca21e98d6beb36557bcb6b68.camel@debian.org> <179577099471.465360.6492357497625968799@localhost> <179512456377.1844508.10007620892073787783.reportbug@deep-thought> <e8303d2f6f525e18e9d372ba838af767a5af13fe.camel@debian.org> <179581706153.482066.2176758311516772864@localhost> <179512456377.1844508.10007620892073787783.reportbug@deep-thought> <179581706153.482066.2176758311516772864@localhost>