LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-29-2009, 09:33 AM   #1
jax8
Member
 
Registered: Feb 2004
Location: Australia
Distribution: Ubuntu, Fedora 10
Posts: 632

Rep: Reputation: 31
Automatically passing values to apt-get installer


Hi

I am currently writing a bash script that will install some software for users given information they enter at the beginning of the script.

The problem is that sometimes the installer pops up with a blue screen where you configure certain aspects of the system.

For example
apt-get install slapd

When this is installed it will pop up with a screen where I have to enter values such as domain name, admin password etc.

How can I do this automatically

I tried:
apt-get install slapd < LDAPconfig

where LDAPconfig contained text and carriage returns where necessary but that did not work.
 
Old 03-29-2009, 10:26 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
As far as I know that is not easy.

You can, however, change those blue dialog screen for something else. e.g. if you do "export DEBIAN_FRONTEND=readline" before the "apt-get" command, then the package configuration program will ask the questions on the terminal.

It looks like then this should work:
Code:
export DEBIAN_FRONTEND=readline
apt-get install slapd <config

# or:
cat config | apt-get install slapd
... but I tried it, and unfortunately it ignores the input from the config file.

The easiest, but abit quick-n-dirty, work-around I can think of now, is to set it so it does not ask any question:
Code:
export DEBIAN_FRONTEND=noninteractive
apt-get install slapd
And then just copy your configuration file(s) over the ones installed by the package. And do some other things the package needs from your script. Like in your example of installing slapd, you probably also want to generate an inital database from an LDIF file.
 
Old 03-29-2009, 11:31 AM   #3
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
You might try to setsid apt-get so it doesn't have a controlling terminal (I assume readline uses ctermid to get an actual terminal instead of standard input.)
Kevin Barry
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing float values in FIFO navderm Programming 3 01-04-2009 03:00 PM
perl - passing values to subroutines sporty Programming 7 08-08-2006 09:13 AM
Passing form values between multiple forms!! AskMe Programming 5 09-07-2005 07:44 PM
Sed Command & Passing Values joey52 Linux - Newbie 4 12-27-2004 07:46 PM
passing values in shell pantera Programming 1 05-20-2004 09:01 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration