LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-19-2012, 09:07 AM   #1
t0bias
Member
 
Registered: Aug 2005
Distribution: Fedora 13, RHEL 5.3, Ubuntu 10.04, Debian Lenny
Posts: 128

Rep: Reputation: 16
script package installation in ubuntu


I am writing an automated installer-script for a webapp of mine running under ubuntu server.
Is there a way to customize the automatic dpkg-configuration that is being executed when apt-get is used for a package installation?
Namely I'd like to ask the user for mysql-server credentials and pass them to the configuration after calling apt-get to install the official repository package.

Thanks,

Tobias
 
Old 12-20-2012, 10:47 PM   #2
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Stretch
Posts: 612

Rep: Reputation: 125Reputation: 125
The fact that you're using apt-get, suggests that you've created a DEB package. Have you read the Debian Polcy Manual thoroughly?

While I've created quite a few packages for my personal use, I've never had the cause to use this.

From Chapter 6 of the manual:
Quote:
Debian Policy Manual
Chapter 6 - Package maintainer scripts and installation procedure


6.1 Introduction to package maintainer scripts


It is possible to supply scripts as part of a package which the package management system will run for you when your package is installed, upgraded or removed.

These scripts are the control information files preinst, postinst, prerm and postrm. They must be proper executable files;
......
6.7 Details of configuration

When we configure a package (this happens with dpkg --install and dpkg --configure), we first update any conffiles and then call:
postinst configure most-recently-configured-version
No attempt is made to unwind after errors during configuration. If the configuration fails, the package is in a "Failed Config" state, and an error message is generated.
You can install the debian-policy package for a local copy of the manual, or view the lastest version on-line at: http://www.debian.org/doc/debian-policy/.

Hope this helps.
 
Old 12-21-2012, 08:43 AM   #3
t0bias
Member
 
Registered: Aug 2005
Distribution: Fedora 13, RHEL 5.3, Ubuntu 10.04, Debian Lenny
Posts: 128

Original Poster
Rep: Reputation: 16
@towheedm: thanks for your reply.
However, that's not quite my point - I only rely on apt-get for the installation of packages which are not customized for this app's purposes but taken as-is from the official repositories.

Therefore I am looking for a way to kind of 'pass by' the interactive package-configuration and handing over previously defined values to the installer script in the background.
 
  


Reply



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
ubuntu package install script psychobyte Linux - Server 1 05-21-2011 02:44 PM
Preventing package installation in Ubuntu 11.04 Worp8d Linux - Newbie 6 05-01-2011 11:41 PM
Script for automated Package installation Iwantslack Slackware 8 12-20-2009 05:47 AM
LXer: Ubuntu TIP: Automating Package Installation – apt-get to the rescue LXer Syndicated Linux News 0 11-27-2008 06:50 PM
message "Problem during installation: x package needed for (installed) x package frayed2 Linux - Newbie 1 04-24-2005 07:05 PM

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

All times are GMT -5. The time now is 11:46 PM.

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