The .deb installation package is a software package format used in Debian based operating systems such as Ubuntu, Linux Mint, and many others. It is a popular format for distributing and managing software.
Here are the details of the .deb package:
.deb packageA .deb package is a compressed file, containing all the components needed to install a software. It usually includes:
control: Metadata files (information about the package):control file is defined as follows:Package: example-package
Version: 1.0.0
Architecture: amd64
Maintainer: Example Team <[email protected]>
Description: Example package for demonstration
Depends: libc6 (>= 2.28), libssl1.1
data.tar: Contains executables, libraries, or configuration files that will be installed on the system.
Examples: /usr/bin, /etc/example.conf, or /usr/lib/example.
debian-binary: A small text file containing only the version of the Debian package (e.g., 2.0).
.deb packages.deb packagesYou can create .deb packages from source code or from pre-prepared files:
Packaging tools:
dpkg-deb: Basic tool for packaging .deb files.
dpkg-deb --build <package_directory>
debuild: Usually used for packaging from source code.
dh_make: Tool to automate the creation of debian/control, rules files.
A sample package directory for the example software has the following structure:
example/
├── DEBIAN/
│ ├── control # Package metadata
│ ├── postinst # Script to run after installation
│ ├── prerm # Script to run before uninstall
├── usr/
│ ├── bin/ # Executable file
│ ├── share/
.debdpkgBasic command to install .deb:
sudo dpkg -i package.deb
If you encounter a dependency error, run:
sudo apt --fix-broken install
apt or gdebi (automatic dependency resolution)gdebi:sudo apt install gdebi
sudo gdebi package.deb
apt:sudo apt install ./package.deb
.deb packageIf the package is already installed, you can remove it with:
dpkg:sudo dpkg -r <package-name>
apt:sudo apt remove <package-name>
If you want to remove the configuration file as well:
sudo apt purge <package-name>
.debIf a package requires other packages (dependencies) that are not installed:
sudo apt --fix-broken install
The .deb package is not compatible with your system architecture (e.g. installing amd64 on an arm64 system):
dpkg --print-architecture
If the installation stops midway:
sudo dpkg --configure -a
.debGood integration on Debian-based systems: Package management systems like dpkg and apt have strong support.
Dependency management: Metadata in the package helps resolve dependencies automatically (with apt).
Customizable: You can add scripts for automation (e.g. postinst, prerm).
.deb package.deb package information:dpkg-deb -I package.deb
.deb package:dpkg-deb -c package.deb
dpkg -l
dpkg -L <package-name>