You are not logged in.
Pages: 1
Is there an equivalent of "mock" (which is for RPM packages) for DEB packages, i.e. a tool that automatically creates a chroot environment to build a DEB package from source retrieving the necessary dependencies from the repos rather than making use of the libraries and dev tools installed on the host system?
I already did a web search for this before starting this thread but couldn't find a clear answer (and I refuse to use hallucinating AI chat bots).
Last edited by tux_99 (2025-11-14 19:37:55)
Offline
If there is no such thing as a Devuan equivalent to "mock" how do you make sure that the list of build dependencies is complete when creating a deb package?
Last edited by tux_99 (2025-11-15 17:45:26)
Offline
Go to the source, the first hit on a search "building debian packages" brings up the wiki article on doing it. The long and short of it is they build them in clean virtual machines it is a rather convoluted process, good luck with it.
Online
What makes the whole deb packaging process so difficult is that there is a bewildering array of packaging tools with overlapping functionality. Also dozens of how-tos that all describe different ways to do it. So as a newbie to deb packaging I don't know which how-to to follow.
For example the one suggested by RedGreen925 says right on top:
Page added to CategoryProposedDeletion
This page has been added to CategoryProposedDeletion. It was first writtin in 2006, and was marked redundant in 2019.
So it would seem that this is not the best guide to follow in 2025...
But by following some links on the above page I found a page about a tool called pbuilder that seems interesting:
https://wiki.debian.org/pbuilder
Is pbuilder something like mock that I should familiarize myself with or is that outdated and no longer useful too?
Just to add: I would like to learn to build deb packages good enough for redistribution, just like "mock" allows on RPM based distros, not to only install on the same system where I build them on (in which case getting the dependencies right wouldn't matter much).
Last edited by tux_99 (2025-11-15 19:45:39)
Offline
Yeah they will get around to removing some time in the next decade or so maybe. And you are correct it is a mess of confusing processes they use.
Online
I haven't actually tried building a package with this setup yet but I followed the following guide that seems to setup a chroot environment for building deb packages comparable to "mock" for rpms: https://stephan.lachnit.xyz/posts/2023- … cacher-ng/
Can somebody with experience please confirm that this guide at the above link is correct and makes sense?
Last edited by tux_99 (Yesterday 03:41:58)
Offline
I think the best way to go about it is to ignore most other documentation and stick to the Debian Maintainers Guide. It also has a section about pbuilder in Chapter 6.
It's packaged for Debian as maint-guide. If you install dhelp you also get easy browsing of all local documentation.
Offline
At the risk of adding more confusion, I have to say sbuild is really where it is at in Debian today: it's the go-to tool for this and actively looked after. If you're on daedalus probably worth using the backport. https://wiki.debian.org/sbuild
Offline
I have to say sbuild is really where it is at in Debian today: it's the go-to tool for this
Thanks for the confirmation, that's the impression I got too, the guide from Stephan Lachnit that I linked in my previous message is based on sbuild and is fairly recent and he's an official Debian developer/packager.
pbuilder seems to have been superseded by sbuild, pbuilder seems to be older and no longer state of the art (although probably still usable).
I think the best way to go about it is to ignore most other documentation and stick to the Debian Maintainers Guide
That was my initial way of thinking too, but it appears that a lot of official guides are not kept up-to-date and therefore don't really teach the current best practices.
Last edited by tux_99 (Yesterday 14:57:10)
Offline
@tux_99
That was my initial way of thinking too, but it appears that a lot of official guides are not kept up-to-date and therefore don't really teach the current best practices.
Read that again, and then explain to me why you think 'sbuild' by an official Debian developer/packager is the best way to go ?
Offline
@g4sra can you please rephrase that, I don't understand what you are trying to say.
Offline
@tux_99
It reads to me like you are saying that the best software to use is that written by the devs that are ignoring best practices and not keeping what they publish up to date.
I find it a little confusing.
Last edited by g4sra (Yesterday 21:19:20)
Offline
@g4sra yes, I find the debian packaging world confusing too (as should have transpired from my previous messages in this thread), but my impression is that for some reason the debian devs find it easier to describe the current process in their own personal blog rather than to go through whatever (presumably complicated) process to update the official debian documentation.
That 'sbuild' is the current "right way" to build debian packages is also stated in this blog by another debian dev (but his how-to is too vague, the one from Stephan Lachnit is much more detailed and therefore easier to follow for a newbie like myself):
https://www.linux.it/~ema/posts/buildin … right-way/
Offline
Pages: 1