Ubuntu: Installing graphite-carbon via apt unattended



Question:

I'm trying to create an automation script that install Graphite without user interaction (unattended).

I try with the following command:

sudo apt-get -q -y --force-yes install graphite-carbon=0.9.12-3  

During the installation, I will be asked whether I want Carbon to remove the database files.

Do you know if there is a way to run an installation without these kind of UI? I have only this problem with Graphite-carbon.


Solution:1

At the moment, I am automating complicated setups too. To accomplish this task, I use AutoExpect. It records keyboard input into an Expect script, which can be run again.

sudo apt-get install expect-dev  

Then you can type

autoexpect  

to start recording. When you are finished, simply type Exit to stop recording and save the script. It will be saved in the directory you are in as script.exp The script will not run directly, you will have to adapt it a bit using a text editor. It will not only apply to the software you are installing, you can use it for about anything. More info:

http://linux.die.net/man/1/autoexpect

http://bit.ly/1u9qTQJ


Solution:2

I have used:

sudo DEBIAN_FRONTEND=noninteractive apt-get -q -y --force-yes install graphite-carbon  

Now it works without any confirmation message.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »