We need to install one packege:
sudo apt-get install build-essential
Creating a Debian package
To do that we use the dpkg-deb tool. First of all, we need to create the debian package structure. The only files required to build a debian package are:
DEBIAN/control
custom files to be part of the package (not required)
First create a directory called helloworld. This directory will hold all necessary package files:
mkdir helloworld
Next, create the DEBIAN directory and the control file:
mkdir helloworld/DEBIAN
vi helloworld/DEBIAN/control
Inside the control file, we enter the following information:
Package: linuxconfig
Version: 1.0
Section: custom
Priority: optional
Architecture: all
Essential: no
Installed-Size: 1024
Maintainer: linuxconfig.org
Description: Print linuxconfig.org on the screen
Great, the only thing that is missing is our helloworld program. Inside the helloworld directory we create a directory tree which represents the path where our program will be installed in the system, and copy the executable into it:
mkdir -p helloworld/usr/bin/
cp /path/to/helloworld helloworld/usr/bin/
At this point we are ready to create the package:
dpkg-deb --build helloworld
dpkg-deb: building package `helloworld ' in `helloworld.deb'.
ls
linuxconfig linuxconfig.deb
You may want to change the name of the package so that it includes the program version and the package architecture. For example:
mv helloworld.deb helloworld-1.0_amd64.deb
All done! Our package is ready! (NOTE: this is just an example, the creation of official packages requires more work).