Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure debconf to be always non-interactive #80

Closed
SimonSapin opened this issue Jul 18, 2012 · 7 comments
Closed

Configure debconf to be always non-interactive #80

SimonSapin opened this issue Jul 18, 2012 · 7 comments
Labels

Comments

@SimonSapin
Copy link

See for example http://travis-ci.org/#!/Kozea/WeasyPrint/jobs/1895338/L208

Even though DEBIAN_FRONTEND=noninteractive is passed explicitly, debconf still tries to ask questions with a ncurses-based interactive interface. Apparently, sudo does not preserve environment variables.

A more permanent fix could be to set Frontend noninteractive near the top of /etc/debconf.conf.

@michaelklishin
Copy link
Contributor

We already configure apt to "assume yes" and that has been sufficient for now. How does your project use debconf?

@michaelklishin
Copy link
Contributor

I think we also need to configure sudo to preserve DEBIAN_FRONTEND, otherwise there will be 10 other tools we need to configured in a similar way.

@SimonSapin
Copy link
Author

My project needs python3-gi-cairo which does not exist in Ubuntu 11.10, so I’m installing it from 12.04.

From .travis.yml:

 - sudo sed -i s/oneiric/precise/ /etc/apt/sources.list
 - sudo apt-get -qy update
 - DEBIAN_FRONTEND=noninteractive sudo apt-get -qy install python3-gi python3-gi-cairo

Doing so also upgrades libc6. debconf then tries to ask "interactively" whether PostgreSQL should be restarted. I don’t care about Postgres though.

@Mezzle
Copy link
Contributor

Mezzle commented Jul 18, 2012

sudo doesn't provide environment - but if you pass it -E it'll pass the environment - as sudo is only ever called by your code, not the internals of travis for this - using -E on sudo should suffice.

@michaelklishin
Copy link
Contributor

It will take some time to upgrade all VM images to have updates sudoers, I think in the meantime if you copy the same file we install in fa89acd in a before_install step and make sure it has permissions 0440 and owned by root, it will be sufficient for now.

So, /etc/sudoers.d/env_keep, owned by root, 0440 with this content:

Defaults        env_keep += "DEBIAN_FRONTEND CI TRAVIS"

@SimonSapin
Copy link
Author

Both of these worked for me: sudo env DEBIAN_FRONTEND=noninteractive apt-get ... or sudo -E apt-get ....

@llucax
Copy link

llucax commented Mar 7, 2014

Or a la make: sudo DEBIAN_FRONTEND=noninteractive apt-get ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants