Building Your Own .deb and .rpm Packages

Building your own .deb or .rpm package lets you distribute internal software through the same familiar mechanism as any other system package — installable, upgradable, and cleanly removable via the normal package manager.

# A minimal .deb package structure
mkdir -p myapp-1.0/DEBIAN
mkdir -p myapp-1.0/usr/local/bin

cp myapp myapp-1.0/usr/local/bin/
Package: myapp
Version: 1.0
Architecture: amd64
Maintainer: you@example.com
Description: My internal application
dpkg-deb --build myapp-1.0
sudo dpkg -i myapp-1.0.deb

# Cleanly removable, exactly like any distro package
sudo dpkg -r myapp

RPM: A Similar Concept, Different Tooling

RPM packages follow the same fundamental idea via a .spec file and the rpmbuild tool instead — the specific format and build commands differ from .deb, but the underlying goal (a well-defined package with metadata, install/uninstall scripts, and dependency declarations) is conceptually identical.