dpkg-reconfigure: unable to re-open stdin: No file or directory

I am building a provisioning script for a ubuntu vagrant vm, on a ubuntu host, both 12.10 64bit When installing the following packages:

sudo apt-get -y install php5-xsl graphviz php-pear unison

I get the warning:

dpkg-reconfigure: unable to re-open stdin: No file or directory

have tried searching but results are throwing up every other error with apt-get possible, can't find out how to supress the warning above. The installs work, but the warning above is causing error lines in the vagrant up stdout.

Anybody any idea what could be the cause or how to suppress the warning


I got the error message to go away by putting the following in my provisioning script, prior to any apt-get calls:

export DEBIAN_FRONTEND=noninteractive

This makes debconf use a frontend that expects no interactive input at all, preventing it from even trying to access stdin.


The answer was to set the perl:locale's as per this:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
dpkg-reconfigure locales

This solves the issue, but does add unwanted time to the vagrant up provisioning.


Run this command:

cat /etc/apt/apt.conf.d/70debconf 

to see if you've this file. If so, the solution is to comment out the DPkg line which prevents pre-configuring all packages with debconf before they are installed.

So add these commands to your provision file:

sudo ex +"%s@DPkg@//DPkg" -cwq /etc/apt/apt.conf.d/70debconf
sudo dpkg-reconfigure debconf -f noninteractive -p critical

Otherwise if you don't care about this file, simply remove it:

sudo rm -v /etc/apt/apt.conf.d/70debconf

Here are few other commands to consider, but I don't think they do anything useful:

sudo dpkg-preconfigure -f noninteractive -p critical
sudo dpkg --configure -a