Debconf
lastmod 2020-03-03created 2020-03-0310 edits
Debconf is the Debian package configuration management system. Packages use Debconf to ask questions when they are installed.
Categories
Non interactive mode
Set the DEBIAN_FRONTEND=noninteractive environment variable.
How to use
First, create the directory and file structure that will hold the files to build.
# 빌드할 대상을 모아놓을 작업 디렉토리:
mkdir pkg-build-essential
# 데비안 패키지 설정 디렉토리 및 파일들:
mkdir pkg-build-essential/DEBIAN
touch pkg-build-essential/DEBIAN/control
touch pkg-build-essential/DEBIAN/preinst
touch pkg-build-essential/DEBIAN/postinst
# 위에서 작성한 DEBIAN 디렉토리 외의 모든 디렉토리는 패키지 설치시 root 디렉토리 밑에 그대로 복사된다.
mkdir pkg-build-essential/usr
mkdir pkg-build-essential/usr/local
mkdir pkg-build-essential/usr/local/bin
mkdir pkg-build-essential/usr/local/lib
mkdir pkg-build-essential/usr/local/include
With dh_make, you can create the directories for Debian packaging interactively.
Write the control file.
Package: pkg-build-essential
Version: 1.3.4
Section: devel
Priority: optional
Architecture: all
Depends: build-essential, subversion, openjdk-7-jdk, libmysqlclient-dev, libmysql++-dev,
libcurl4-openssl-dev,libjson0, libjson0-dev, libjsoncpp0, libjsoncpp-dev, python-twisted-core,
flex, cmake
Recommends: libjson0-dbg, python-mysqldb
Maintainer: Developers <[email protected]>
Homepage: http://kukuta.tistory.com
Description: Server Development base library install package
1.0.1 : bug fetch..#1
1.1.1 : bug fetch..#2
1.2.0 : bug fetch..#3
When content spans multiple lines, from the second line on there must be a whitespace character such as a tab or space at the very start of the line.
For packaging, use the dpkg command.
When it finishes, a pkg-build-essential.deb file is created.
To install, use dpkg -i {패키지경로}. However, it does not automatically download the packages listed in Depends; instead it fails with an error that those packages are required but not installed. To have dependent packages installed automatically, use gdebi.
Or just install it the easy way with apt-get.
Basic install step
On first install:
$ sudo apt-get install ./answer-pack_1.0.0.deb
Preparing to unpack .../c2pack/answer-pack_1.0.0.deb ...
[new-preinst] install(old-version=1.0.0,new-version=1.0.0)
Unpacking answer-pack (1.0.0) ...
Setting up answer-pack (1.0.0) ...
[postinst] configure(old-version=1.0.0)
On update:
$ sudo apt-get install ./answer-pack_1.0.1.deb
Preparing to unpack .../c2pack/answer-pack_1.0.1.deb ...
[old-prerm] upgrade(new-version=1.0.1)
[new-preinst] upgrade(old-version=1.0.0,new-version=1.0.1)
Unpacking answer-pack (1.0.1) over (1.0.0) ...
[old-postrm] upgrade(new-version=1.0.1)
Setting up answer-pack (1.0.1) ...
[postinst] configure(old-version=1.0.0)
On removal:
$ sudo apt-get remove answer-pack
Removing answer-pack (1.0.1) ...
[prerm] remove()
[postrm] remove()
Troubleshooting
If a debconf package was misconfigured, you can reconfigure it as follows:
See also
- gdebi
- apt-get
Favorite site
- Creating an Ubuntu package
- Creating a custom Debian package
- Ubuntu Manpage: debconf - developers guide
- Package: debconf (1.5.73)
- KThan's information warehouse :: (Ubuntu) Debian package - running a Django application on Apache
- Create a Debian package for your Django application