Here are my notes about Debian packages.
Now, what is a Debian package?
Package contain all the files which are necessary to implement set of commands or features.
A Debian package, or a Debian archive file, contains the executable files, libraries, and documentation associated with a particular suite of program or set of related programs.
According to wikipedia, ” Debian packages are standard Unix ar archives that include two tar archives optionally compressed with gzip (zlib), Bzip2, lzma, or xz (lzma2): one archive holds the control information and another contains the program data”.
Here I would mention meaning of various terms used in wiki definition:
- ar : archiver or ar is a Unix utility that maintains groups of files as a single archive file (file composed of one or more computer files).
tar: Initially, tar archives were used to store files on magnetic tape. The name “Tar” comes from this use; it stands for tape archiver. Despite the utility’s name, Tar can direct its output to available devices, files, or other programs (using pipes), it can even access remote devices or files (as archives).
- gzip: gzip is a software application used for file compression and decompression.
bzip2 : is a free and open source file compressor.
- Lzma: The Lempel–Ziv–Markov chain algorithm (LZMA) is an algorithm used to perform lossless data compression.
dpkg is used for handling debian packages.
dpkg is used to install, remove, and provide information about .deb packages.
Debian Package has a filename that ends in .deb.
There are two types of Debian packages:
Binary packages : It is a type of ad-hoc packaging (built sysytem specific). So such packages are more likely to fail to operate when target system diverges from original environment from where they were built . They are usually distinguished by having a ‘.deb’ file extension.
- Source packaging: It can be built to produce “binary ” packages on any other machine. They consist of a .dsc file, .orig.tar.gz file and .diff.gz file.
Meaning of unknown, install, remove, purge and hold in the package status
- unknown – the user has never indicated whether he wants the package
- install – the user wants the package installed or upgraded
- remove – the user wants the package removed, but does not want to remove any existing configuration files.
- purge – the user wants the package to be removed completely, including its configurationfiles.
- hold – the user wants this package not to be processed, i.e., he wants to keep the current version with the current status whatever that is.
Installing a source package
Debian packages cannot be actually installed, they are just unpacked in whatever directory you want to build the source package.
One can download the source package by running the following command:
apt-get source "packagename"