Auto accept license pkgin

Are there any tricks to installing a package with a license acceptance requirement. I’m using pkgin to install sun-jre and it is failing. I was just wondering if anyone has any suggestions for auto-accepting the sun license agreement.

Cheers,
Paul

If you're on ubuntu or debian, you just need to issue these commands before
installing the package:

$ echo debconf shared/accepted-oracle-license-v1-1 select true | \
  sudo debconf-set-selections
$ echo debconf shared/accepted-oracle-license-v1-1 seen true | \
  sudo debconf-set-selections

-Erik

I’m assuming BSD, you probably have to add to the ACCEPTABLE_LICENSES variable (check BSD distro for where to do so). Adding it to environment: on your task might even work.

Missed that. Nevermind my email.

...perhaps it may be useful in the future for debian/ubuntu types. :slight_smile:

@erik, I’m in last stages of getting a debconf module accepted, so I hope that even that won’t be the case :wink:

That is *great* news. Thanks for your work in it!

Thanks everyone. I’m running pkgin on Smartos. I added the ACCEPTABLE_LICENSES (ACCEPTABLE_LICENSES= sun-jre) to the mk.conf file in /opt/local/share/mk folder. Works great.

But I think setting an environment variable in the ansible is easier. In my case, I set it in the role vars file.

license_env:
ACCEPTABLE_LICENSES: ‘sun-jre6’

And then in the task:

  • name: Install Java
    pkgin: name=sun-jre6 state=present
    environment: license_env
    tags: logstash

Thanks,
Paul