Ubuntu 16.04 install fails because sudoers template conflicts with sudo package template

Bug #1659952 reported by Alex Konradi
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
VMBuilder
Fix Committed
Undecided
Vacheslav Anzhiganov

Bug Description

The `ubuntu/sudoers.tmpl` template that gets installed as /etc/sudoers conflicts with the version provided by the sudo package. apt prompts for a manual resolution, but since the install is non-interactive, it fails instead. A simple workaround is to prevent the template from being installed for Ubuntu Xenial (16.04) by overriding the `create_initial_user()` method in the Xenial plugin class, copying it from the parent (Dapper) class but removing the line that installs the sudoers template.

Revision history for this message
vanzhiganov (vanzhiganov-ya) wrote :

can you clarify command executing?

Revision history for this message
Alex Konradi (alexkonradi) wrote :
Download full text (3.6 KiB)

The actual command that executes is

/usr/bin/python /usr/bin/ubuntu-vm-builder vmw6 xenial -v --arch i386 --domain localdomain --hostname vm-6858 --mem 512 --mirror http://mirrors.mit.edu/ubuntu/ --tmpfs 4096 --components main,universe,multiverse --addpkg linux-image-generic --addpkg build-essential --addpkg ubuntu-standard --addpkg openssh-server --addpkg libacl1-dev --addpkg python --addpkg vim --addpkg emacs --addpkg curl --addpkg libssl-dev --addpkg netcat --addpkg execstack --addpkg python-sqlalchemy --addpkg python-setuptools --addpkg python-flask --addpkg python-lxml --addpkg xvfb --addpkg valgrind --addpkg firefox --addpkg git --addpkg phantomjs --addpkg python-pysqlite2 --addpkg slimit --addpkg open-vm-tools --addpkg autoconf --addpkg dos2unix --addpkg python3.5-venv --addpkg pkg-config --addpkg libfuse-dev --addpkg libffi-dev --addpkg python3.5-dev --addpkg libattr1-dev --addpkg libssl-dev --addpkg pcregrep --addpkg gdb --addpkg bc --removepkg ubuntu-release-upgrader-core --user httpd --pass 6858 --exec vm-fixup.sh --dest vm-6858

where vm-fixup.sh is a post-processing script that changes a couple config files.

Here's a snippet from the install log:

Setting up libp11-kit0:i386 (0.23.2-5~ubuntu16.04.1) ...
Setting up libtasn1-6:i386 (4.7-3ubuntu0.16.04.1) ...
Setting up libgnutls30:i386 (3.4.10-4ubuntu1.1) ...
Setting up libgnutls-openssl27:i386 (3.4.10-4ubuntu1.1) ...
Setting up lsb-release (9.20160110ubuntu0.2) ...
Setting up sudo (1.8.16-0ubuntu1.2) ...

Configuration file '/etc/sudoers'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
      D : show the differences between the versions
      Z : start a shell to examine the situation
 The default action is to keep your current version.
*** sudoers (Y/I/N/O/D/Z) [default=N] ? dpkg: error processing package sudo (--configure):
 end of file on stdin at conffile prompt
Setting up kbd (1.15.5-1ubuntu5) ...
Setting up console-setup-linux (1.108ubuntu15.2) ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-1.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-13.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-14.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-15.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-2.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-3.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-4.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-7.inc ...
Installing new version of config file /etc/console-setup/compose.ISO-8859-9.inc ...
Setting up console-setup (1.108ubuntu15.2) ...
Your console font configuration will be updated the next time your system
boots. If you want to update it now, run 'setupcon' from a virtual console.
update-initramfs: deferring update (trigger activat...

Read more...

Revision history for this message
Vacheslav Anzhiganov (vanzhiganov) wrote :

can you find in file /usr/lib/python2.7/dist-packages/VMBuilder/plugins/ubuntu/dapper.py next string:

self.run_in_target('apt-get', '-y', '--force-yes', 'dist-upgrade',

and replace with:

self.run_in_target('apt-get', '-y', '--force-yes', '--option=Dpkg::Options::=--force-confnew', 'dist-upgrade',

and try to build new vm after that.

I describe similar situation on my blog http://anzhiganov.com/2016/11/02/869/. it was useful for me.

Changed in vmbuilder:
assignee: nobody → vanzhiganov (vanzhiganov)
Revision history for this message
Alex Konradi (alexkonradi) wrote :

Yup, that does it. The VM build successfully with the force-confnew option.

Revision history for this message
Vacheslav Anzhiganov (vanzhiganov) wrote :
Changed in vmbuilder:
status: New → Fix Committed
Revision history for this message
Eric Freeyoung (eric-freeyoung) wrote :

I've encountered the same bug and I confirmed that the fix above did resolve my issue.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

When will this fix be released? This is very annoying.

Revision history for this message
Vasiliy Romaneev (entervuz) wrote :

You can find the fix there: https://askubuntu.com/a/824159/434621

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.