Skip to content

Instantly share code, notes, and snippets.

@SpareSimian
Last active May 28, 2024 01:20
Show Gist options
  • Save SpareSimian/e2d813263dac488d794e6f8d12d5fbf7 to your computer and use it in GitHub Desktop.
Save SpareSimian/e2d813263dac488d794e6f8d12d5fbf7 to your computer and use it in GitHub Desktop.
Building a Debian package

Building a Debian package

The following assumes a user named "builder" will be created to build packages.

  • Create a Debian instance
  • Update package database: apt-get update
  • Install basic build system: apt-get install build-essential fakeroot devscripts
  • Create mortal to build package and add to sudoers: adduser builder
  • Add mortal to sudoers: usermod -aG sudo builder
  • Allow mortal to sudo without password (optional): Create /etc/sudoers.d/builder-nopasswd containing: builder ALL=(ALL) NOPASSWD:ALL
  • Become mortal: su -l builder
  • Aquire the source in ~builder/packagename
  • Acquire any dependencies: mk-build-deps debian/control && sudo apt-get install ./packagename-build-deps_*_all.deb
  • Rebuild the unmodified binary package, unsigned: debuild -b -uc -us
  • Install the package: sudo apt install ~builder/packagename.deb

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment