Home >Common Problem >What is the format of deb?
deb is the Debian software package format. It is an installation package format exclusive to Debian systems (including Debian and Ubuntu). Together with the APT software management system, it has become a very popular installation package under Linux. The deb package consists of three parts: 1. Data package, including the actual installed program data; 2. Installation information and control script package, including deb installation instructions, logos, scripts, etc.; 3. Some binary data of the deb file, including files First class information.
#The operating environment of this tutorial: Ubuntu 22 system, Dell G3 computer.
DEB is the Debian software package format. The Debian package is a standard Unix archive file. The package file information and package content are packaged through gzip and tar.
What is the deb format?
deb is the file extension for Debian software package format.
The deb format is an installation package format exclusive to Debian systems (including Debian and Ubuntu). Together with the APT software management system, it has become a very popular installation package under Linux. After entering the 2.x era, Cydia author JayFreeman (saurik) transplanted it to the iPhone platform, along with the APT software management system.
Debian package is a standard archive of Unixar, which packages the package file information and package contents through gzip and tar. The classic program for handling these packages is dpkg, often operated through Debian's apt-get. Through the Alien tool, you can convert deb packages into rpm and tar.gz formats.
The deb package in the Linux operating system is similar to the software package (exe) in windows. It requires almost no complicated compilation and can be installed and used with a mouse click.
The deb package itself consists of three parts: the data package, which contains the actual installed program data, and the file name is data.tar.XXX; the installation information and control script package, which contains the deb installation instructions, logos, scripts, etc. The file name is control.tar.gz; the last one is some binary data of the deb file, including file header and other information, which is generally invisible, but can be seen when opened in some software.
deb itself can use different compression methods. The tar format is not a compression format, but directly gathers scattered files and directories together and records their permissions and other data information. Data.tar.XXX mentioned before, where XXX is the compressed suffix name. The compression format used by deb by default is gzip format, so the most common one is data.tar.gz. Common compression formats include bzip2 and lzma. Among them, lzma has the highest compression rate, but compression requires relatively long CPU resources and time.
data.tar.gz contains the actual installed program data, and during the installation process, the data in the package will be directly decompressed to the root directory (i.e. /), so you need to follow the file before packaging Set the corresponding file/directory tree at the location.
The control.tar.gz contains the control information required for a deb installation. There are generally 5 files: control, used to record software identification, version number, platform, dependency information and other data; preinst, a script run before unpacking data.tar.gz; postinst, a script run after unpacking data; prerm, a script that runs before deleting files when uninstalling; postrm, a script that runs after deleting files;
In the Cydia system, Cydia author Saurik added another script, extrainst_, which has a similar function to postinst .
DEB installation package features:
Rich resources: There are many on Cydia itself, not to mention any format All installation packages can be converted to deb.
Relatively convenient online purchase mode: CydiaStore, but although there is no limit of 5 devices in the App Store, the payment method is more difficult for domestic users.
Cracking is difficult and the AppStore verification method is not used, so verification and anti-cracking measures must be added to the program. This makes it more difficult to crack, which is a good thing for software developers. .
Complete Unix file system support: no need to set file permissions, owners and user groups with commands (of course it can also be set with scripts)
Perfect script support: 5 scripts are executed in the order of installation and uninstallation, which can provide more choices. For example, for backup and restore operations, you can back up files in preinst and restore files in postrm
Strict dependencies: deb follows strict dependencies (specified in Depends and Pre-Depends) , which ensures the components necessary for the software to run. Dependent software packages will be automatically installed during online installation. It is also important to uninstall. For example, software package A depends on B. When uninstalling B, it will prompt that A depends on B. Uninstalling B will cause A to become unusable. This can ensure the integrity and stability of the system.
The existence of key values such as Conflicts, Replaces, and Provides can implement conflict prompts or replace other software packages.
Full permissions: Since deb must run as root with the highest authority, deb can operate anywhere in the system. In other words, deb has full control over the entire system, so deb The installation package software can realize many functions that cannot be realized by ipa.
Relatively simple acquisition method (online or offline) and installation method, and there is no need to worry about deleting the program when synchronizing on different machines.
The installation is relatively simple: In fact, no matter what kind of installation package it is, the installation method is not very complicated, but deb is a little more complicated.
For more related knowledge, please visit the FAQ column!
The above is the detailed content of What is the format of deb?. For more information, please follow other related articles on the PHP Chinese website!