Ask Your Question

How to accept EULA when installing package

asked 2018-04-09 14:07:11 -0600

tylerecouture gravatar image

I'm trying to install ttf-mscorefonts-installer but it doesn't work. When I install manually I get a EULA pop up which I need to click OK on.

Is there a way to get puppet to do this during the install process?

  package{'ttf-mscorefonts-installer' }
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-05-01 06:34:39 -0600

updated 2018-05-01 06:41:54 -0600

Yes, there is.

On Debian-like systems there exists the Debian configuration management system debconf(1). On a system where the package is (or was already) installed, you can do (as root)

debconf-get-selections | grep -B1 --no-group-separator ttf-mscorefonts-installer

and this will output something like

# Declined "TrueType core fonts for the Web EULA "
ttf-mscorefonts-installer   msttcorefonts/error-mscorefonts-eula    error   
# Mirror to download from:
ttf-mscorefonts-installer   msttcorefonts/dlurl string  
# Font files not found
ttf-mscorefonts-installer   msttcorefonts/baddldir  error   
# Do you accept the EULA license terms?
ttf-mscorefonts-installer   msttcorefonts/accepted-mscorefonts-eula boolean true
# TrueType core fonts for the Web EULA
ttf-mscorefonts-installer   msttcorefonts/present-mscorefonts-eula  note    
# Directory holding MS fonts (if already downloaded):
ttf-mscorefonts-installer   msttcorefonts/dldir string

You can edit this accordingly (i.e. only snip the relevant lines/“selections”), and share the contents as a file resource and point your package resource to such a responsefile. This would look like this:

class msshit {
    file { 'ttf_mscorefonts_installer_preseed':
        path                          => '/var/cache/debconf/ttf-mscorefonts-installer.preseed',
        ensure                        => file,
        mode                          => '0644',
        owner                         => 'root',
        group                         => 'root',
        content                       => template('msshit/corefonts_installer_preseed.erb'),
        # just mentioning: "validating" is always a good idea (esp. for templates)
        validate_cmd                  => '/usr/bin/debconf-set-selections --verbose --checkonly %',

    package { 'ttf_mscorefonts_installer':
        name                          => 'ttf-mscorefonts-installer',
        ensure                        => present,
        # specifying responsefile autorequires file resource
        responsefile                  => File['ttf_mscorefonts_installer_preseed']['path'],

Limitations: The responsefile is only considered for _fresh_ installations, where the package is not installed. If you've already rolled out “install package ttf-mscorefonts-installer” globally, you'd have to run debconf-show ttf-mscorefonts-installer, then grep(1) for the proper output and run dpkg-reconfigure(8) in an exec resource.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-04-09 14:07:11 -0600

Seen: 275 times

Last updated: May 01