#1030717 pbuilder doesn't work with libpam-tmpdir

Package:
pbuilder
Source:
pbuilder
Submitter:
Harald Dunkel
Date:
2026-07-31 20:44:05 UTC
Severity:
normal
Tags:
#1030717#5
Date:
2023-02-06 18:11:16 UTC
From:
To:
Apparently libpam-tmpdir:amd64 (0.09+b2) breaks pbuilder. Sample session:

% sudo DIST=sid ARCH=amd64 EXTRAPACKAGES="ca-certificates" pbuilder create
:
Setting up openssl (3.0.7-2) ...
Setting up ca-certificates (20211016) ...
mktemp: failed to create file via template '/tmp/user/0/ca-certificates.tmp.XXXXXX': No such file or directory
dpkg: error processing package ca-certificates (--configure):
   installed ca-certificates package post-installation script subprocess returned error exit status 1
Setting up libcwidget4:amd64 (0.5.18-6) ...
Setting up aptitude (0.8.13-5) ...
update-alternatives: using /usr/bin/aptitude-curses to provide /usr/bin/aptitude (aptitude) in auto mode
Processing triggers for libc-bin (2.36-8) ...
Errors were encountered while processing:
   ca-certificates

E: Sub-process /usr/bin/dpkg returned an error code (1)
I: unmounting dev/ptmx filesystem
I: unmounting dev/pts filesystem
:

% 1082} dpkg -l coreutils pbuilder libpam-tmpdir
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-============================================
ii  coreutils      9.1-1        amd64        GNU core utilities
ii  libpam-tmpdir  0.09+b2      amd64        automatic per-user temporary directories
ii  pbuilder       0.231        all          personal package builder for Debian packages


Logfile is attached. If I kick out libpam-tmpdir there is no such problem.
But this would be very painful. Do you think pbuilder could create the missing
directory tree in /tmp instead?


Regards
Harri

#1030717#10
Date:
2023-02-06 19:11:48 UTC
From:
To:
Harald Dunkel dixit:

This seems to be bogus. Packages cannot rely on specific per-system
configuration, such as trees below /tmp, or $HOME, during build, so
I’d say something is done wrong here, and I very much doubt it is
in pbuilder.

What’s going on here, anyway?

• pam doesn’t run in chroots, or does it?
• libpam-tmpdir seems to have an RC bug (uninstallability)
  caused by it not creating the needed parent directories itself?
• why is libpam-tmpdir in a --variant=buildd chroot, anyway?
• or do you just fail to unset $TMPDIR before calling pbuilder? Hah!

You may be running into the latter. I strongly recommend to use a
wrapper around cowbuilder/pbuilder invocations; see specifically
https://github.com/mirabilos/shellsnippets/blob/ab3ffb3714d8600c98d23102ed65a7d08383c11e/mksh/debian-dev/c#L127
and also https://github.com/mirabilos/shellsnippets/blob/ab3ffb3714d8600c98d23102ed65a7d08383c11e/mksh/debian-dev/c#L35
which apparently became necessary at some point as well.

Please try:

sudo env --unset=XDG_RUNTIME_DIR --unset=TMPDIR DIST=sid ARCH=amd64 EXTRAPACKAGES="ca-certificates" pbuilder create

(Your command, with env(1) intermediate added. Just “sudo foo=bar”
is not reliable/portable anyway.)

Does this fix your issue, when used ceteris paribus?

bye,
//mirabilos

#1030717#15
Date:
2023-02-12 09:13:28 UTC
From:
To:
AFAICS the env --unset=TMPDIR is a workaround. I can live with that.


Thank you very much
Harri