I'm trying to build *.deb packages into a chroot. When building the first package - bash, there were difficulties. I build packages using debootstrap and chroot.

  • I install debootstrap: sudo debootstrap stable /stable-chroot http://deb.debian.org/debian/;

  • I install the packages I need: apt -y install wget dpkg-dev devscripts dh-make locales;

  • Configure locale;

  • Configure /etc/apt/source.list - add deb-src http://deb.debian.org/debian bullseye main

  • Downloading the source to build - apt source bash(or using wget from the debian website)

  • Install build dependency - apt build-dep bash

  • And, finally, build - debuild -b(also tried with dpkg-buildpackage)

As a result, I get this error when building a bash package:

mkdir -p stamps : # see #327477, needed to have HAVE_DEV_STDIN defined (test -d /dev/fd && test -r /dev/stdin < /dev/null)
|| (test -d /proc/self/fd && test -r /dev/stdin < /dev/null) make: *** [debian/rules:102: before-build] Error 1 dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

I tried to find it on the Internet, but did not succeed, and my knowledge is not enough to understand the essence of this error on my own. Tell me, please, maybe I have to tweak something in the build environment or do I need some additional packages?

1 Answer 1


The bash build needs a working /proc and /dev, so you need to bind-mount them into your chroot before entering it.

Instead of doing all this manually, you’d probably find it easier to use a tool such as pbuilder or sbuild which will take care of all this for you. To get started with pbuilder, install it, run

sudo pbuilder create

and then run pdebuild instead of debuild.

  • I make:sudo mount -o bind /dev /stable-chroot/dev; sudo mount -o bind /sys /stable-chroot/sys; sudo mount -t proc /proc /stable-chroot/proc And it seems to have helped!
    – Darron
    Commented Jul 13, 2022 at 10:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .