Marius Stanca.

Create DPKG package for Debian Linux distribution


Let's create a dpkg package for Debian.
For our example, install using the command: apt-get install build-essential.
After that, create a small program using C language and compile it:

#include <iostream>

int main()
    using namespace std;
    cout << "\n";

    return 0;

Compile it:
==> g++ -o example

Now let's create package structure folders and files.

==> mkdir example
==> cd example
==> mkdir DEBIAN
==> vi DEBIAN/control

==> # Put this information

Package: example
Version: 1.0
Section: custom
Priority: optional
Architecture: all
Essential: no
Installed-Size: 1024
Description: Print on the screen

==> mkdri -p usr/bin/ # Specify where you want to put the program
==> cp /path/from/example_program usr/bin/
==> cd ..
==> dpkg-deb --build example # Create package

After that, you will see the package built:
==> example/ example.deb

© 2018. Build with Python and Skeleton.