Ubuntu – How to correct this error with debootstrap in Ubuntu Server 12.04.3

12.04debootstrap

When using the tool xen-create-image I get an error with the debootstrap process.

Running

root@xen/tmp# debootstrap --arch amd64 precise /tmp/ubuntu 
I: Retrieving Release
I: Retrieving Release.gpg
I: Checking Release signature
I: Valid Release signature (key id 630239CC130E1A7FD81A27B140976EAF437D05B5)
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Checking component main on http://us.archive.ubuntu.com/ubuntu...
I: Retrieving adduser

...
I: Extracting xz-utils...
I: Extracting zlib1g...
I: Installing core packages...
W: Failure trying to run: chroot /tmp/ubuntu dpkg --force-depends --install /var/cache/apt/archives/debconf_1.5.42ubuntu1_all.deb

So I tried running:

chroot /tmp/ubuntu dpkg –force-depends –install
/var/cache/apt/archives/debconf_1.5.42ubuntu1_all.deb

Interactively.

root@xen:/# chroot /tmp/ubuntu dpkg --force-depends --install /var/cache/apt/archives/debconf_1.5.42ubuntu1_all.deb
(Reading database ... 1944 files and directories currently installed.)
Preparing to replace debconf 1.5.42ubuntu1 (using .../debconf_1.5.42ubuntu1_all.deb) ...
Illegal instruction (core dumped)
dpkg: warning: subprocess old pre-removal script returned error exit status 132
dpkg - trying script from the new package instead ...
Illegal instruction (core dumped)
dpkg: error processing /var/cache/apt/archives/debconf_1.5.42ubuntu1_all.deb (--install):
 subprocess new pre-removal script returned error exit status 132
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
debconf: falling back to frontend: Teletype
Illegal instruction (core dumped)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 132
Errors were encountered while processing:
 /var/cache/apt/archives/debconf_1.5.42ubuntu1_all.deb

The output: Illegal instruction (core dumped) Seems to imply some fundamental problem with debconf or something. Is there a way to work around this problem so I can get the debootstrap script to run without errors?

Best Answer

Try

apt-get install dialog

Found it here after having the same problem. (I did debootstrap wheezy --variant=minbase)

Alternatively, you can use

export DEBIAN_FRONTEND=noninteractive

before running apt-get. This will fallback to a pure text console interface which also works in scripts or Dockerfiles.

Related Question