3

I'm trying to make a basic script for deployment of ocs-inventory and I got stuck on a problem.

When I issue this command:

sudo apt-get install -y ocsinventory-agent

The interactive window appears. The only thing I need to do is press enter.

It's the same type of graphic prompt which you get when you are installing kerberos5.

Is there any possibility to include the "enter" in script ?

4

Basically you have to preseed the answer for debconf:

sudo apt-get install debconf-utils
echo "ocsinventory-agent ocsinventory-agent/method select local" | sudo debconf-set-selections
sudo apt-get install -y --force-yes ocsinventory-agent

You can obviously change local by server for your needs.

  • Still not working, Getting stuck on the point where i need to choose local directory or https server – user257131 Mar 18 '14 at 15:21
  • I've updated my answer as you need to prefill the debconf database to avoid the package configuration screen – Sylvain Pineau Mar 18 '14 at 16:13
1

Try the following:

You can do a couple of things for avoiding this

First set the variable export DEBIAN_FRONTEND=noninteractive then you can run apt-get -y install [packagename], this should do exactly what you want.

Source: https://serverfault.com/questions/227190/how-do-i-ask-apt-get-to-skip-any-interactive-post-install-configuration-steps

  • Hello, I did what you suggested but it's not working Still getting to promt. – user257131 Mar 18 '14 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.