Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   configuring packages from script (http://www.linux-archive.org/debian-user/468748-configuring-packages-script.html)

Bob Proulx 12-23-2010 05:04 PM

configuring packages from script
 
George Shuklin wrote:
> Now I need to do same thing from script. I know I can change
> configuration file directly, but will it right solution?
>
> Is any way to supply replies to debconf during some package
> reconfiguration?

There are several ways. I like setting the EDITOR variable to a perl
script that will make the changes I desire and then select the editor
frontend for the task.

For example, the following configures the default paper size in
libpaper to be a US-centric "letter" default instead of "a4".

# With the frontend set to editor we get a file and we only need to
# change the value on the line from yes to no.
EDITOR='perl -pi -e "s@libpaper/defaultpaper=.*@libpaper/defaultpaper="'"letter"'"@"'
dpkg-reconfigure --frontend=editor libpaper1

You may want to set
export DEBCONF_ADMIN_EMAIL=""
to avoid any email, if email were to be sent.

Bob


All times are GMT. The time now is 01:53 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.