def preseed_package(pkg_name, preseed):
 for (q_name, _) in preseed.items():
  (q_type, q_answer) = _
  run_as_root(('echo "%(pkg_name)s %(q_name)s %(q_type)s %(q_answer)s" | debconf-set-selections' % locals()))

def preseed_package ( pkg_name , preseed ) : for ( q_name , _ ) in preseed . items ( ) : ( q_type , q_answer ) = _ run_as_root ( ( 'echo "%(pkg_name)s %(q_name)s %(q_type)s %(q_answer)s" | debconf-set-selections' % locals ( ) ) )
enable unattended package installation by preseeding debconf parameters .