Marius Stanca.

Create DPKG package for Debian Linux distribution

2017-02-03

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 << "mariuss.pro\n";

    return 0;
}

Compile it:
==> g++ example.cc -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
Maintainer: mariuss.pro
Description: Print mariuss.pro 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. mariuss.me. Build with Python and Skeleton.