Debian packages (.deb) are the standard distribution format. Building custom packages requires source and metadata.
A source package consists of three files:
.orig.tar.gz — original upstream source.debian.tar.gz or .diff.gz — Debian-specific patches and metadata.dsc — metadata file (dependencies, checksums)Example:
hello_2.10-1.orig.tar.gz hello_2.10-1.debian.tar.gz hello_2.10-1.dsc
Extract source package:
dpkg-source -x hello_2.10-1.dsc cd hello_2.10-1
This unpacks upstream source and applies Debian patches.
Install build dependencies:
cd hello_2.10-1 sudo apt build-dep .
Build package:
debuild # builds, signs, creates .deb debuild -us -uc # builds, no GPG signing dpkg-buildpackage # lower-level alternative
Output: .deb file in parent directory.
Install locally-built package:
sudo dpkg -i hello_2.10-1_amd64.deb sudo apt install ./hello_2.10-1_amd64.deb # also resolves dependencies
Create simple debian/ directory structure:
source/ ├── debian/ │ ├── control # package metadata │ ├── rules # build instructions │ ├── changelog # version history │ └── copyright # license info └── main.c
Minimal debian/control:
Source: myapp Maintainer: Your Name <[email protected]> Section: utils Priority: optional Build-Depends: debhelper-compat (= 13) Standards-Version: 4.6.0 Package: myapp Architecture: any Depends: ${shlibs:Depends} Description: My Application A brief description.
Minimal debian/rules:
#!/usr/bin/make -f %: dh $@
Then build:
debuild -us -uc
To formally contribute: 1. Check existing packages 2. Understand Debian Policy 3. Create quality package 4. Find sponsor (established developer) 5. Submit patch or new package 6. Go through review process
debian/control — package metadata, dependenciesdebian/rules — build rules (often just dh $@)debian/changelog — version history (mandatory format)debian/copyright — license and copyright infodebian/install — files to installdebian/systemd/ — systemd unitsdebhelper (dh) to simplify debian/rules/usr/bin, not /opt/bindebclean or debuild cleanlintian package.deb checks for common issuesBuilding quality packages requires testing and knowledge of Debian conventions.