SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
Introduction 1
What is Package System and Benefits 2
Known Package Management Systems on Linux Systems 2
Known Package Types On Linux Systems 3
Create Package for Debian Based Systems 3
What is Debian (.deb) Package? 3
What is Dependence? 4
Preconditions for Creating a Debian (.deb) Package 4
Install From Source Code 5
Create Debian (.deb) Package 6
Testing The Debian (.deb) Package 8
Updating an Existing Debian (.deb) Package. 8
Creating a Manual Debian (.deb) Package 9
Control File 11
Preinst File 12
Postinst File 12
Postrm & Prerm Files 13
Test Time 14
Displaying The Directory Structure 15
About The Author 16
Introduction
I will explain how to prepare a Debian package that all linux users can understand in this
article. Debian based Linux systems although there is a huge package repository,
sometimes it may be necessary to install a package which is not in the repository. In such a
case, as you can install the application from source code, you can also install the application
directly from the package manager by making it a .deb package.
Sometimes, a package in a package repository may not be enough for us to install values,
so we want to prepare the own package. For example, There is a squid3 package and it is
ready to install in the package repository but with this install, the sslbump feature may don't
come that we may need for squid. While installing from the source code also another way is
making it as a ( .deb ) package.
What is Package System and Benefits
Linux users and system managers need programs, drivers etc. They benefit from the
package repository to install dependencies with system tools.
The ready to install setups are expressed as a package for users install a package and
managing easily, ( updates, remove, version etc.)
For example, when you would like to install chrome application in your Linux system
( debian, ubuntu, etc. ). You just find the install link for chrome, download into the system
and without having to waste time setting up after the preconditions is completed. Using the
ready to install packages already in the package repository can save important time and
prevent any possible errors. Installing with "apt-get install chromium" takes seconds.
Known Package Management Systems on Linux Systems
apt =​ The goal of APT is to make life easier for users who use Debian based linux
distributions and to make system package management more understandable.
yum =​ This is using for package management in red-hat based distributions. The yum
features include: manage package, install package, remove a package, information of
package, update, etc.
aptıtude = ​This package manager was using especially in uninstalling dependencies also it
was good package manager at a long time ago. They all have the same function except for
some small usage changes.
pkg =​ This is the new package manager and it came with FreeBSD 10 operation system.
The pkg features include: install package, remove, update, lock/unlock the package.
Known Package Types On Linux Systems
Below is a list of mostly used package types in Linux based systems.
.rpm =​ This package type is developed by Red Hat also it has many powerful features and it
is adapted to many linux distributions.
.deb =​ This package type is also created for Debian based systems.
Create Package for Debian Based Systems
What is Debian (.deb) Package?
Debian packages are the packages that contain all the files necessary to apply the
commands or features.
Debian packages are divided to two;
Binary packages:​ This package contains the executive files, configuration files, man/info
pages and others documentations.
Source packages:​ Sources packages, the .dsc file that specifies of this package.
.orig.tar.gz file containing the original source code in the archive and .diff.gz file containing
the debian-specific changes in the file.
What is Dependence?
Dependency is the package needed for the package to work/compile.
There are two different dependence;
Build Dependency: ​Packages needed for package compilation.
Runtime Dependency:​ Packages needed for the package to work.
Preconditions for Creating a Debian (.deb) Package
We need to install some tools for create/prepare a debian package. Be sure you installed
properly the tools. First, we should update the system repository after that we may use the
following second command to install the tools what we need.
Note:​ Make sure that tools installed properly on the system. You can use this command for
check ( dpkg -s package_name ).
root#​ apt-get update ; apt-get upgrade -y
root# ​aptitude install build-essential binutils fakeroot lintian debhelper dh-make devscripts
patch libc6-dev file checkinstall makefile
Install From Source Code
The bzip2 tool is has used in this article as an example tool. In this example, I install bzip2
tool from the source code into the system and then we make it as a .deb package.
While I was preparing this article, I worked on this system. The commands, dependencies
may can be changed in differents linux systems.
Operating system features used;
Distributor ID: Debian
Description : Debian GNU/Linux 8.1 (jessie)
Version : 8.1
Kod adı : jessie
Let’s get it start.
First, we should create a directory in a random directory then enter into the directory and
after that install the bzip2 example tool. In this example, a directory called ​"test"​ is created
in the ​/home​ directory and entered in the directory after that installed the tool in this
directory.
root#​ cd /home/ ; mkdir test ; cd test
root#​ wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
First command going to open the bzip2.tar.gz file with tar command into the ​/home/test
directory and then we enter the directory that opens.
root#​ tar xvf bzip2-1.0.6.tar.gz -C /home/test/
root# ​cd /home/test/bzip2-1.0.6
Usually, many program's source codes comes with the ​INSTALL​ and ​README​ files. If you
don't know what is the program doing, how to install, how works, dependencies etc, it is so
helpful to read these files.
Note:​ When you using the following commands, you should be in ​bzip2-1.0.6/​ directory.
root#​ make
root# ​ make install
Create Debian (.deb) Package
We installed the bzip2 tool and we may use the following command convert this tool to the
.deb package. In the menu below we can edit the necessary areas by entering the number of
the information that we want to change.
Note:​ I didn't use dh_make command because it was too old, that's why I decided to use
debmake or checkinstall tools. These are so easy to use and so useful.
root#​ checkinstall -D make install
*****************************************
*** Debian package creation selected ***
*****************************************
This package will be built according to these values:
0 - Maintainer: [ ucribrahim@gmail.com ]
1 - Summary: [ This is my simple .deb package ]
2 - Name: [ bzip2 ]
3 - Version: [ 1.0.6 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ amd64 ]
8 - Source location: [ bzip2-1.0.6 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ bzip2 ]
Enter a number to change any of them or press ENTER to continue:
Installing with make install...
========================= Installation results ===========================
if ( test ! -d /usr/local/bin ) ; then mkdir -p /usr/local/bin ; fi
if ( test ! -d /usr/local/lib ) ; then mkdir -p /usr/local/lib ; fi
if ( test ! -d /usr/local/man ) ; then mkdir -p /usr/local/man ; fi
chmod a+r /usr/local/man/man1/bzmore.1
chmod a+r /usr/local/man/man1/bzdiff.1
echo ".so man1/bzgrep.1" > /usr/local/man/man1/bzegrep.1
======================== Installation successful ==========================
Copying documentation directory...
./
./LICENSE
./README.XML.STUFF
./README.COMPILATION.PROBLEMS
./README
./CHANGES
Copying files to the temporary directory...OK
Compressing man pages...OK
Building file list...OK
Deleting temp dir...OK
********************************************************************
Done. The new package has been installed and saved to
/home/test/bzip2-1.0.6/bzip2_1.0.6-1_amd64.deb
You can remove it from your system anytime using:
dpkg -r bzip2
********************************************************************
You see the above results that mean the bzip2 tool is prepared. We can access the package
from this way (​ /home/test/bzip2-1.0.6/bzip2_1.0.6-1_amd64.deb​ ). If we want to remove it
that just we can use "dpkg -r bzip2" command.
Testing The Debian (.deb) Package
Package we have prepared, we can use scp, filezilla etc. tools send to another debian based
system for test and you can use the following commands to install package for test that we
have prepared. At the end of this, we will save time and we will not have to problems every
time to install from source code.
root# ​dpkg -i bzip2_1.0.6-1_amd64.deb
Updating an Existing Debian (.deb) Package.
If we want to take updates that we have prepared our own package, we can use the
following command.
root# ​apt-get install apt-file -y
Creating a Manual Debian (.deb) Package
In this part of the article, we will not use the source code of the tool. We will create our own
files and use bash to write the necessary commands into these files and prepare our own
.deb package.
Before start the topic, let’s look at the files what files are doing.
DEBIAN/control:​ This file what we will write program name, version, size, description,
dependencies of the file. Here is the contents of this file.
Package :​ Name of the application.
Version :​ Version of the application.
Source :​ The name of the application can be written.
Section :​ Which category the application entered.
Priority :​ The necessity of the application for the system.
Maintainer :​ The name or email address of the developer.
Architecture :​ Which architects are for.
Depends : ​Which packages it depend on. We separate to package names with commas (,).
Description :​ We can may write here a few sentences about what application doing.
DEBIAN/preinst : ​This file is the first start running while application is being installed.
Backup commands are usually written into this file when you update. You can write these
commands with bash or another language.
DEBIAN/postinst :​ This file is start after preinst file. Commands are written into this file for
the operations to be performed after installing the application.
DEBIAN/postrm or DEBIAN/prerm:​ Commands are written into this one of the both files for
delete the application.
DEBIAN/copyright :​ This file is contained the about package license information for the
debian system. You can review the license information section at
( ​https://www.debian.org/social_contract.en.html​ )
DEBIAN/rules :​ This is a ​Makefile​ for your debian package. Install a debian package with
dpkg command by to the information in this file.
DEBIAN/changelog :​ This file is a logbook describing the development of the program. If
you do something about program ( new features, resolved bugs, etc. ) you can write into this
file.
DEBIAN/readme & DEBIAN/install :​ Actually many linux users knows that what these files
are doing :). Usually the author is write information into this file about the how to install
program or what is this program doing etc.
Let’s get it start.
First, a directory named ​test​ is created in the ​/home ​directory.
root# ​mkdir /home/ibrahim/test
And then create a file called ​file.tar.gz​, which contains a ​test.txt​ file. After that use the
following command create a file called ​tmp​ in the ​test​ directory and when we create a file
called ​file.tar.gz​, it is sent into the ​tmp​ directory.
Note:​ When you send the file which called file.tar.gz, it shouldn’t be open. If you want to see
the contains of the file.tar.gz use this command ( tar tf file.tar.gz )
root# ​mkdir /home/ibrahim/test/tmp
root# ​cp /home/file.tar.gz /home/ibrahim/test/tmp/
Now we will use the following first command to create a file which is called ​DEBIAN​ into the
/​home/ibrahim/test/​ directory. (​The name must be DEBIAN​) After that we enter the
directory which is called ​DEBIAN​ and create the necessary files in this directory.
root# ​mkdir /home/ibrahim/test/DEBIAN
root# ​cd /home/ibrahim/test/DEBIAN
root# ​touch control postinst prerm
root# ​ls -l
Control File
This file what we will write program name, version, size, description, dependencies of the
file. Here is the contains of the file. After writing as below, you can press ​CTRL+O​ followed
by the ​enter​ key to save it, and then press ​CTRL+X​ to exit.
Note :​ In this area you can add or modify new areas by to your own.
root# ​nano control
Package: test
Version: 1.1.1
Architecture: all
Essential: no
Section: web
Priority: optional
Depends: php5 (>=2.3), php5-mysql
Maintainer: İbrahim UÇAR
Description: This is my example .deb package.
Preinst File
This file is start first running when a program installed. Backup commands are usually written
into this file when you update. This file isn’t in my example that’s why I won’t use this file in
article. If you want check the program updates, you should create this file and write
necessary commands into this file.
Postinst File
This file start running after preinst file. This file contains the operations to be performed after
the application is installed. Let me explain the topic for example after we installed the
package into the system, a directory will create which called is ​test​ into the ​/tmp​ directory.
Then the file named ​file.tar.gz​ will be opened in the ​/tmp/test​ directory which is created.
Copy all the sentences and paste it directly.
root# ​nano postinst
#!/bin/sh
FILE=file.tar.gz
DIRECTORY=test
mkdir -p "/tmp/$DIRECTORY"
tar xf "/tmp/$FILE" -C "/tmp/$DIRECTORY/"
Postrm & Prerm Files
These two files name are different but they are doing the same job. We will write commands
into this one of the two files for remove the package from the system. We are writing the
below commands into the which named is prerm file. This file will start, when a user has
used ( dpk -r test.deb , apt-get remove test​ ​) these commands to remove the package from
the system. The contents of the file are as follows.
Note:​ In my example, deleting the directory​ /tmp/test​ test is included. And bash command is
written into this file.
root# ​nano prerm
#!/bin/sh
if [ "$1" = "remove" ]; then
rm -rf /tmp/test
fi
Now It’s time to build .deb package. We will complete the mission and have own .deb
package when we use the following commands.
● In the first command, we created the .deb package with the existing directory name.
● In the second command, we created the .deb package with another name.
root# ​dpkg-deb --build /home/ibrahim/test/
dpkg-deb: building package `test in `test.deb'.
root# ​ls
test ​test.deb
root# ​dpkg-deb --build /home/ibrahim/test/ test.1.2.3.deb
dpkg-deb: building package `test in `test.1.2.3.deb'.
root# ​ls
test ​test.1.2.3.deb
Now we can use the following command for install the .deb package into the system.
root# ​dpkg -i test.deb
or
root# ​dpkg -i test.1.2.3.deb
If we want to remove the .deb package from the system, we can use the following
commands.
root# ​dpkg -r test.deb
or
root# ​dpkg -r test.1.2.3.deb
Test Time
In this stage, we will test own package is working or not by made manually. You can follow
the steps below.
After you had used below command, a directory will create which called is ​test​ into the ​/tmp
directory. Then the file named ​file.tar.gz​ will be opened in the ​/tmp/test​ directory which is
created.
As you can see output below, everything works correctly. The necessary file was opened
successfully where necessary directory. But If you can’t see the output as below as in your
system this means you missed something at somewhere.
root# ​dpkg -i test.1.2.3.deb
( Reading database ... 130889 files and directories currently installed.)
Preparing to unpack test.1.2.3.deb ...
Unpacking test (1.4.2) ...
Setting up test (1.4.2) …
root# ​ls -alh /tmp/test/ibrahimucar/
-rwxrwxr-x 1 ibrahim ibrahim 67 Nov 6 04:37 ​ test.txt
If we want to remove the package which is installed into the system. We can use the
following commands. Then you can look at the ​/tmp/test/ibrahimucar​ directory and you can
see that there is no such like this file.
root# ​dpkg -r test.1.2.3
( Reading database ... 130889 files and directories currently installed.)
Preparing to unpack test.1.2.3.deb ...
Unpacking test (1.4.2) ...
Setting up test (1.4.2) …
root# ​ls -alh /tmp/test/ibrahimucar/
ls: cannot access /tmp/test/ibrahimucar/: No such file or directory
Displaying The Directory Structure
After all the process are finished, we can use the following command if we want to see the
directory structure.
root# ​tree test
├── DEBIAN
│ ├── conffiles
│ ├── control
│ ├── postinst
│ └── prerm
└── tmp
└── file.tar.gz
2 directories, 5 files
About The Author
Author: İbrahim UÇAR
First Published Date: 16.01.2017
Contact Information;
➔ ucribrahim@gmail.com
➔ twitter.com/ucribrahim
➔ lifeoverlinux.com

Weitere ähnliche Inhalte

Was ist angesagt?

Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingBeni Krisbiantoro
 
Anthony McKeown Drupal Presentation
Anthony McKeown Drupal PresentationAnthony McKeown Drupal Presentation
Anthony McKeown Drupal PresentationTony McKeown
 
linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
 
Linux system admin useful commands
Linux system admin useful commandsLinux system admin useful commands
Linux system admin useful commandsali98091
 
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...Edureka!
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystemsAcácio Oliveira
 
Linux Security Quick Reference Guide
Linux Security Quick Reference GuideLinux Security Quick Reference Guide
Linux Security Quick Reference Guidewensheng wei
 
RPM: Speed up your deploy
RPM: Speed up your deployRPM: Speed up your deploy
RPM: Speed up your deployfcrippa
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinuxtutorialsruby
 
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
Part 6 of "Introduction to linux for bioinformatics": Productivity tipsPart 6 of "Introduction to linux for bioinformatics": Productivity tips
Part 6 of "Introduction to linux for bioinformatics": Productivity tipsJoachim Jacob
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linuxVicent Selfa
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0venkatakrishnan k
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebookYash Gulati
 

Was ist angesagt? (20)

Tutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk WebhostingTutorial CentOS 5 untuk Webhosting
Tutorial CentOS 5 untuk Webhosting
 
Anthony McKeown Drupal Presentation
Anthony McKeown Drupal PresentationAnthony McKeown Drupal Presentation
Anthony McKeown Drupal Presentation
 
linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014linux-commandline-magic-Joomla-World-Conference-2014
linux-commandline-magic-Joomla-World-Conference-2014
 
Modul server debian 5
Modul server debian 5Modul server debian 5
Modul server debian 5
 
Refcard en-a4
Refcard en-a4Refcard en-a4
Refcard en-a4
 
Linux system admin useful commands
Linux system admin useful commandsLinux system admin useful commands
Linux system admin useful commands
 
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
 
Linux commands
Linux commandsLinux commands
Linux commands
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Linux final exam
Linux final examLinux final exam
Linux final exam
 
Linux Security Quick Reference Guide
Linux Security Quick Reference GuideLinux Security Quick Reference Guide
Linux Security Quick Reference Guide
 
RPM: Speed up your deploy
RPM: Speed up your deployRPM: Speed up your deploy
RPM: Speed up your deploy
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
 
Nelf2012
Nelf2012Nelf2012
Nelf2012
 
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
Part 6 of "Introduction to linux for bioinformatics": Productivity tipsPart 6 of "Introduction to linux for bioinformatics": Productivity tips
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebook
 

Andere mochten auch

Red-Hat 7 Yeni Güvenlik Duvarı : firewalld
Red-Hat 7 Yeni Güvenlik Duvarı : firewalldRed-Hat 7 Yeni Güvenlik Duvarı : firewalld
Red-Hat 7 Yeni Güvenlik Duvarı : firewalldİbrahim UÇAR
 
İş Ortamlarına Saldırı Tespit Sisteminin Kurulması
İş Ortamlarına Saldırı Tespit Sisteminin Kurulmasıİş Ortamlarına Saldırı Tespit Sisteminin Kurulması
İş Ortamlarına Saldırı Tespit Sisteminin Kurulmasıİbrahim UÇAR
 
Linux Türevi İşletim Sistemlerinde Paket Hazırlama.
Linux Türevi İşletim Sistemlerinde Paket Hazırlama.Linux Türevi İşletim Sistemlerinde Paket Hazırlama.
Linux Türevi İşletim Sistemlerinde Paket Hazırlama.İbrahim UÇAR
 
Linux Yaz Kampı 2016 pfSense Firewall ve Router Eğitim Dökümanı
Linux Yaz Kampı 2016 pfSense Firewall ve Router Eğitim DökümanıLinux Yaz Kampı 2016 pfSense Firewall ve Router Eğitim Dökümanı
Linux Yaz Kampı 2016 pfSense Firewall ve Router Eğitim Dökümanıİbrahim UÇAR
 
Marketing jobs in qatar
Marketing jobs in qatarMarketing jobs in qatar
Marketing jobs in qatarGulfinity
 
Virtual Learning with ON24
Virtual Learning with ON24Virtual Learning with ON24
Virtual Learning with ON24Shairy Pabon
 
All eyes on S4 - Gamification in customer engagement - Manu Melwin Joy
All eyes on S4 - Gamification in customer engagement - Manu Melwin JoyAll eyes on S4 - Gamification in customer engagement - Manu Melwin Joy
All eyes on S4 - Gamification in customer engagement - Manu Melwin Joymanumelwin
 
常用授權素材平台
常用授權素材平台常用授權素材平台
常用授權素材平台佩琪 羅
 
Web Çatı Şablonlarının Güvenliği (SSTI) - Özgür Web Günleri 2016
Web Çatı Şablonlarının Güvenliği (SSTI) - Özgür Web Günleri 2016Web Çatı Şablonlarının Güvenliği (SSTI) - Özgür Web Günleri 2016
Web Çatı Şablonlarının Güvenliği (SSTI) - Özgür Web Günleri 2016Ömer Çıtak
 
Financial statement analysis of JK Tyre and CEAT Tyre
Financial statement analysis of JK Tyre and CEAT TyreFinancial statement analysis of JK Tyre and CEAT Tyre
Financial statement analysis of JK Tyre and CEAT TyreNAVEENA KODALI
 
Pfsense başlangıç
Pfsense başlangıçPfsense başlangıç
Pfsense başlangıçsmartpro
 
pfSense Firewall ve Router Eğitimi
pfSense Firewall ve Router EğitimipfSense Firewall ve Router Eğitimi
pfSense Firewall ve Router EğitimiBGA Cyber Security
 

Andere mochten auch (20)

Red-Hat 7 Yeni Güvenlik Duvarı : firewalld
Red-Hat 7 Yeni Güvenlik Duvarı : firewalldRed-Hat 7 Yeni Güvenlik Duvarı : firewalld
Red-Hat 7 Yeni Güvenlik Duvarı : firewalld
 
İş Ortamlarına Saldırı Tespit Sisteminin Kurulması
İş Ortamlarına Saldırı Tespit Sisteminin Kurulmasıİş Ortamlarına Saldırı Tespit Sisteminin Kurulması
İş Ortamlarına Saldırı Tespit Sisteminin Kurulması
 
Linux Türevi İşletim Sistemlerinde Paket Hazırlama.
Linux Türevi İşletim Sistemlerinde Paket Hazırlama.Linux Türevi İşletim Sistemlerinde Paket Hazırlama.
Linux Türevi İşletim Sistemlerinde Paket Hazırlama.
 
Linux Yaz Kampı 2016 pfSense Firewall ve Router Eğitim Dökümanı
Linux Yaz Kampı 2016 pfSense Firewall ve Router Eğitim DökümanıLinux Yaz Kampı 2016 pfSense Firewall ve Router Eğitim Dökümanı
Linux Yaz Kampı 2016 pfSense Firewall ve Router Eğitim Dökümanı
 
Marketing jobs in qatar
Marketing jobs in qatarMarketing jobs in qatar
Marketing jobs in qatar
 
Bio
BioBio
Bio
 
Real estate investment
Real estate investmentReal estate investment
Real estate investment
 
Virtual Learning with ON24
Virtual Learning with ON24Virtual Learning with ON24
Virtual Learning with ON24
 
All eyes on S4 - Gamification in customer engagement - Manu Melwin Joy
All eyes on S4 - Gamification in customer engagement - Manu Melwin JoyAll eyes on S4 - Gamification in customer engagement - Manu Melwin Joy
All eyes on S4 - Gamification in customer engagement - Manu Melwin Joy
 
Presentatie didacttool
Presentatie didacttoolPresentatie didacttool
Presentatie didacttool
 
Informe transmision
Informe transmisionInforme transmision
Informe transmision
 
Viento
VientoViento
Viento
 
Operations strategy
Operations strategyOperations strategy
Operations strategy
 
常用授權素材平台
常用授權素材平台常用授權素材平台
常用授權素材平台
 
HISTORIA CLÍNICA NARRATIVA
HISTORIA CLÍNICA NARRATIVAHISTORIA CLÍNICA NARRATIVA
HISTORIA CLÍNICA NARRATIVA
 
Web Çatı Şablonlarının Güvenliği (SSTI) - Özgür Web Günleri 2016
Web Çatı Şablonlarının Güvenliği (SSTI) - Özgür Web Günleri 2016Web Çatı Şablonlarının Güvenliği (SSTI) - Özgür Web Günleri 2016
Web Çatı Şablonlarının Güvenliği (SSTI) - Özgür Web Günleri 2016
 
Financial statement analysis of JK Tyre and CEAT Tyre
Financial statement analysis of JK Tyre and CEAT TyreFinancial statement analysis of JK Tyre and CEAT Tyre
Financial statement analysis of JK Tyre and CEAT Tyre
 
Pfsense başlangıç
Pfsense başlangıçPfsense başlangıç
Pfsense başlangıç
 
Pathways To Happiness for Areas with Low Happiness Scores in Satisfaction wit...
Pathways To Happiness for Areas with Low Happiness Scores in Satisfaction wit...Pathways To Happiness for Areas with Low Happiness Scores in Satisfaction wit...
Pathways To Happiness for Areas with Low Happiness Scores in Satisfaction wit...
 
pfSense Firewall ve Router Eğitimi
pfSense Firewall ve Router EğitimipfSense Firewall ve Router Eğitimi
pfSense Firewall ve Router Eğitimi
 

Ähnlich wie How to Build Package in Linux Based Systems.

The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packagesJeremiah Foster
 
Debian Packaging tutorial
Debian Packaging tutorialDebian Packaging tutorial
Debian Packaging tutorialnussbauml
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo PlatformJeremiah Foster
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)Thierry Gayet
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linuxnejadmand
 
Nuget is easier than you think and you should be using it as both a consumer ...
Nuget is easier than you think and you should be using it as both a consumer ...Nuget is easier than you think and you should be using it as both a consumer ...
Nuget is easier than you think and you should be using it as both a consumer ...Justin James
 
101 2.4 use debian package management
101 2.4 use debian package management101 2.4 use debian package management
101 2.4 use debian package managementAcácio Oliveira
 
Advanced Usage of the Debian Packaging System
Advanced Usage of the Debian Packaging SystemAdvanced Usage of the Debian Packaging System
Advanced Usage of the Debian Packaging SystemAdam Gonnerman
 
Software Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionSoftware Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionJian-Hong Pan
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Ahmed El-Arabawy
 
How to build Debian packages
How to build Debian packages How to build Debian packages
How to build Debian packages Priyank Kapadia
 
ovs-2.3.1 on debian 8.1
ovs-2.3.1 on debian 8.1ovs-2.3.1 on debian 8.1
ovs-2.3.1 on debian 8.1Clive Peng
 
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Simon Boulet
 

Ähnlich wie How to Build Package in Linux Based Systems. (20)

The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packages
 
Debian Packaging tutorial
Debian Packaging tutorialDebian Packaging tutorial
Debian Packaging tutorial
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo Platform
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
 
$ make install
$ make install$ make install
$ make install
 
Debian packaging
Debian packagingDebian packaging
Debian packaging
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linux
 
Nuget is easier than you think and you should be using it as both a consumer ...
Nuget is easier than you think and you should be using it as both a consumer ...Nuget is easier than you think and you should be using it as both a consumer ...
Nuget is easier than you think and you should be using it as both a consumer ...
 
101 2.4 use debian package management
101 2.4 use debian package management101 2.4 use debian package management
101 2.4 use debian package management
 
Debian Packaging
Debian PackagingDebian Packaging
Debian Packaging
 
Advanced Usage of the Debian Packaging System
Advanced Usage of the Debian Packaging SystemAdvanced Usage of the Debian Packaging System
Advanced Usage of the Debian Packaging System
 
Linuxconcepts
LinuxconceptsLinuxconcepts
Linuxconcepts
 
Software Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionSoftware Packaging for Cross OS Distribution
Software Packaging for Cross OS Distribution
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management
 
How to build Debian packages
How to build Debian packages How to build Debian packages
How to build Debian packages
 
ovs-2.3.1 on debian 8.1
ovs-2.3.1 on debian 8.1ovs-2.3.1 on debian 8.1
ovs-2.3.1 on debian 8.1
 
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
Deploying with Super Cow Powers (Hosting your own APT repository with reprepro)
 
Linux
LinuxLinux
Linux
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Red Hat Training
Red Hat   TrainingRed Hat   Training
Red Hat Training
 

Kürzlich hochgeladen

Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceDelhi Call girls
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.soniya singh
 
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.soniya singh
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...nilamkumrai
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls DubaiEscorts Call Girls
 

Kürzlich hochgeladen (20)

Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 

How to Build Package in Linux Based Systems.

  • 1. Introduction 1 What is Package System and Benefits 2 Known Package Management Systems on Linux Systems 2 Known Package Types On Linux Systems 3 Create Package for Debian Based Systems 3 What is Debian (.deb) Package? 3 What is Dependence? 4 Preconditions for Creating a Debian (.deb) Package 4 Install From Source Code 5 Create Debian (.deb) Package 6 Testing The Debian (.deb) Package 8 Updating an Existing Debian (.deb) Package. 8 Creating a Manual Debian (.deb) Package 9 Control File 11 Preinst File 12 Postinst File 12 Postrm & Prerm Files 13 Test Time 14 Displaying The Directory Structure 15 About The Author 16
  • 2. Introduction I will explain how to prepare a Debian package that all linux users can understand in this article. Debian based Linux systems although there is a huge package repository, sometimes it may be necessary to install a package which is not in the repository. In such a case, as you can install the application from source code, you can also install the application directly from the package manager by making it a .deb package. Sometimes, a package in a package repository may not be enough for us to install values, so we want to prepare the own package. For example, There is a squid3 package and it is ready to install in the package repository but with this install, the sslbump feature may don't come that we may need for squid. While installing from the source code also another way is making it as a ( .deb ) package. What is Package System and Benefits Linux users and system managers need programs, drivers etc. They benefit from the package repository to install dependencies with system tools. The ready to install setups are expressed as a package for users install a package and managing easily, ( updates, remove, version etc.) For example, when you would like to install chrome application in your Linux system ( debian, ubuntu, etc. ). You just find the install link for chrome, download into the system and without having to waste time setting up after the preconditions is completed. Using the ready to install packages already in the package repository can save important time and prevent any possible errors. Installing with "apt-get install chromium" takes seconds.
  • 3. Known Package Management Systems on Linux Systems apt =​ The goal of APT is to make life easier for users who use Debian based linux distributions and to make system package management more understandable. yum =​ This is using for package management in red-hat based distributions. The yum features include: manage package, install package, remove a package, information of package, update, etc. aptıtude = ​This package manager was using especially in uninstalling dependencies also it was good package manager at a long time ago. They all have the same function except for some small usage changes. pkg =​ This is the new package manager and it came with FreeBSD 10 operation system. The pkg features include: install package, remove, update, lock/unlock the package. Known Package Types On Linux Systems Below is a list of mostly used package types in Linux based systems. .rpm =​ This package type is developed by Red Hat also it has many powerful features and it is adapted to many linux distributions. .deb =​ This package type is also created for Debian based systems.
  • 4. Create Package for Debian Based Systems What is Debian (.deb) Package? Debian packages are the packages that contain all the files necessary to apply the commands or features. Debian packages are divided to two; Binary packages:​ This package contains the executive files, configuration files, man/info pages and others documentations. Source packages:​ Sources packages, the .dsc file that specifies of this package. .orig.tar.gz file containing the original source code in the archive and .diff.gz file containing the debian-specific changes in the file. What is Dependence? Dependency is the package needed for the package to work/compile. There are two different dependence; Build Dependency: ​Packages needed for package compilation. Runtime Dependency:​ Packages needed for the package to work.
  • 5. Preconditions for Creating a Debian (.deb) Package We need to install some tools for create/prepare a debian package. Be sure you installed properly the tools. First, we should update the system repository after that we may use the following second command to install the tools what we need. Note:​ Make sure that tools installed properly on the system. You can use this command for check ( dpkg -s package_name ). root#​ apt-get update ; apt-get upgrade -y root# ​aptitude install build-essential binutils fakeroot lintian debhelper dh-make devscripts patch libc6-dev file checkinstall makefile Install From Source Code The bzip2 tool is has used in this article as an example tool. In this example, I install bzip2 tool from the source code into the system and then we make it as a .deb package. While I was preparing this article, I worked on this system. The commands, dependencies may can be changed in differents linux systems. Operating system features used; Distributor ID: Debian Description : Debian GNU/Linux 8.1 (jessie) Version : 8.1 Kod adı : jessie
  • 6. Let’s get it start. First, we should create a directory in a random directory then enter into the directory and after that install the bzip2 example tool. In this example, a directory called ​"test"​ is created in the ​/home​ directory and entered in the directory after that installed the tool in this directory. root#​ cd /home/ ; mkdir test ; cd test root#​ wget http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz First command going to open the bzip2.tar.gz file with tar command into the ​/home/test directory and then we enter the directory that opens. root#​ tar xvf bzip2-1.0.6.tar.gz -C /home/test/ root# ​cd /home/test/bzip2-1.0.6 Usually, many program's source codes comes with the ​INSTALL​ and ​README​ files. If you don't know what is the program doing, how to install, how works, dependencies etc, it is so helpful to read these files. Note:​ When you using the following commands, you should be in ​bzip2-1.0.6/​ directory. root#​ make root# ​ make install
  • 7. Create Debian (.deb) Package We installed the bzip2 tool and we may use the following command convert this tool to the .deb package. In the menu below we can edit the necessary areas by entering the number of the information that we want to change. Note:​ I didn't use dh_make command because it was too old, that's why I decided to use debmake or checkinstall tools. These are so easy to use and so useful. root#​ checkinstall -D make install ***************************************** *** Debian package creation selected *** ***************************************** This package will be built according to these values: 0 - Maintainer: [ ucribrahim@gmail.com ] 1 - Summary: [ This is my simple .deb package ] 2 - Name: [ bzip2 ] 3 - Version: [ 1.0.6 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ bzip2-1.0.6 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ bzip2 ] Enter a number to change any of them or press ENTER to continue: Installing with make install... ========================= Installation results =========================== if ( test ! -d /usr/local/bin ) ; then mkdir -p /usr/local/bin ; fi if ( test ! -d /usr/local/lib ) ; then mkdir -p /usr/local/lib ; fi if ( test ! -d /usr/local/man ) ; then mkdir -p /usr/local/man ; fi chmod a+r /usr/local/man/man1/bzmore.1 chmod a+r /usr/local/man/man1/bzdiff.1 echo ".so man1/bzgrep.1" > /usr/local/man/man1/bzegrep.1 ======================== Installation successful ==========================
  • 8. Copying documentation directory... ./ ./LICENSE ./README.XML.STUFF ./README.COMPILATION.PROBLEMS ./README ./CHANGES Copying files to the temporary directory...OK Compressing man pages...OK Building file list...OK Deleting temp dir...OK ******************************************************************** Done. The new package has been installed and saved to /home/test/bzip2-1.0.6/bzip2_1.0.6-1_amd64.deb You can remove it from your system anytime using: dpkg -r bzip2 ******************************************************************** You see the above results that mean the bzip2 tool is prepared. We can access the package from this way (​ /home/test/bzip2-1.0.6/bzip2_1.0.6-1_amd64.deb​ ). If we want to remove it that just we can use "dpkg -r bzip2" command.
  • 9. Testing The Debian (.deb) Package Package we have prepared, we can use scp, filezilla etc. tools send to another debian based system for test and you can use the following commands to install package for test that we have prepared. At the end of this, we will save time and we will not have to problems every time to install from source code. root# ​dpkg -i bzip2_1.0.6-1_amd64.deb Updating an Existing Debian (.deb) Package. If we want to take updates that we have prepared our own package, we can use the following command. root# ​apt-get install apt-file -y
  • 10. Creating a Manual Debian (.deb) Package In this part of the article, we will not use the source code of the tool. We will create our own files and use bash to write the necessary commands into these files and prepare our own .deb package. Before start the topic, let’s look at the files what files are doing. DEBIAN/control:​ This file what we will write program name, version, size, description, dependencies of the file. Here is the contents of this file. Package :​ Name of the application. Version :​ Version of the application. Source :​ The name of the application can be written. Section :​ Which category the application entered. Priority :​ The necessity of the application for the system. Maintainer :​ The name or email address of the developer. Architecture :​ Which architects are for. Depends : ​Which packages it depend on. We separate to package names with commas (,). Description :​ We can may write here a few sentences about what application doing. DEBIAN/preinst : ​This file is the first start running while application is being installed. Backup commands are usually written into this file when you update. You can write these commands with bash or another language. DEBIAN/postinst :​ This file is start after preinst file. Commands are written into this file for the operations to be performed after installing the application. DEBIAN/postrm or DEBIAN/prerm:​ Commands are written into this one of the both files for delete the application. DEBIAN/copyright :​ This file is contained the about package license information for the debian system. You can review the license information section at ( ​https://www.debian.org/social_contract.en.html​ )
  • 11. DEBIAN/rules :​ This is a ​Makefile​ for your debian package. Install a debian package with dpkg command by to the information in this file. DEBIAN/changelog :​ This file is a logbook describing the development of the program. If you do something about program ( new features, resolved bugs, etc. ) you can write into this file. DEBIAN/readme & DEBIAN/install :​ Actually many linux users knows that what these files are doing :). Usually the author is write information into this file about the how to install program or what is this program doing etc. Let’s get it start. First, a directory named ​test​ is created in the ​/home ​directory. root# ​mkdir /home/ibrahim/test And then create a file called ​file.tar.gz​, which contains a ​test.txt​ file. After that use the following command create a file called ​tmp​ in the ​test​ directory and when we create a file called ​file.tar.gz​, it is sent into the ​tmp​ directory. Note:​ When you send the file which called file.tar.gz, it shouldn’t be open. If you want to see the contains of the file.tar.gz use this command ( tar tf file.tar.gz ) root# ​mkdir /home/ibrahim/test/tmp root# ​cp /home/file.tar.gz /home/ibrahim/test/tmp/ Now we will use the following first command to create a file which is called ​DEBIAN​ into the /​home/ibrahim/test/​ directory. (​The name must be DEBIAN​) After that we enter the directory which is called ​DEBIAN​ and create the necessary files in this directory. root# ​mkdir /home/ibrahim/test/DEBIAN root# ​cd /home/ibrahim/test/DEBIAN root# ​touch control postinst prerm root# ​ls -l
  • 12. Control File This file what we will write program name, version, size, description, dependencies of the file. Here is the contains of the file. After writing as below, you can press ​CTRL+O​ followed by the ​enter​ key to save it, and then press ​CTRL+X​ to exit. Note :​ In this area you can add or modify new areas by to your own. root# ​nano control Package: test Version: 1.1.1 Architecture: all Essential: no Section: web Priority: optional Depends: php5 (>=2.3), php5-mysql Maintainer: İbrahim UÇAR Description: This is my example .deb package. Preinst File This file is start first running when a program installed. Backup commands are usually written into this file when you update. This file isn’t in my example that’s why I won’t use this file in article. If you want check the program updates, you should create this file and write necessary commands into this file.
  • 13. Postinst File This file start running after preinst file. This file contains the operations to be performed after the application is installed. Let me explain the topic for example after we installed the package into the system, a directory will create which called is ​test​ into the ​/tmp​ directory. Then the file named ​file.tar.gz​ will be opened in the ​/tmp/test​ directory which is created. Copy all the sentences and paste it directly. root# ​nano postinst #!/bin/sh FILE=file.tar.gz DIRECTORY=test mkdir -p "/tmp/$DIRECTORY" tar xf "/tmp/$FILE" -C "/tmp/$DIRECTORY/" Postrm & Prerm Files These two files name are different but they are doing the same job. We will write commands into this one of the two files for remove the package from the system. We are writing the below commands into the which named is prerm file. This file will start, when a user has used ( dpk -r test.deb , apt-get remove test​ ​) these commands to remove the package from the system. The contents of the file are as follows. Note:​ In my example, deleting the directory​ /tmp/test​ test is included. And bash command is written into this file. root# ​nano prerm #!/bin/sh if [ "$1" = "remove" ]; then rm -rf /tmp/test fi
  • 14. Now It’s time to build .deb package. We will complete the mission and have own .deb package when we use the following commands. ● In the first command, we created the .deb package with the existing directory name. ● In the second command, we created the .deb package with another name. root# ​dpkg-deb --build /home/ibrahim/test/ dpkg-deb: building package `test in `test.deb'. root# ​ls test ​test.deb root# ​dpkg-deb --build /home/ibrahim/test/ test.1.2.3.deb dpkg-deb: building package `test in `test.1.2.3.deb'. root# ​ls test ​test.1.2.3.deb Now we can use the following command for install the .deb package into the system. root# ​dpkg -i test.deb or root# ​dpkg -i test.1.2.3.deb If we want to remove the .deb package from the system, we can use the following commands. root# ​dpkg -r test.deb or root# ​dpkg -r test.1.2.3.deb
  • 15. Test Time In this stage, we will test own package is working or not by made manually. You can follow the steps below. After you had used below command, a directory will create which called is ​test​ into the ​/tmp directory. Then the file named ​file.tar.gz​ will be opened in the ​/tmp/test​ directory which is created. As you can see output below, everything works correctly. The necessary file was opened successfully where necessary directory. But If you can’t see the output as below as in your system this means you missed something at somewhere. root# ​dpkg -i test.1.2.3.deb ( Reading database ... 130889 files and directories currently installed.) Preparing to unpack test.1.2.3.deb ... Unpacking test (1.4.2) ... Setting up test (1.4.2) … root# ​ls -alh /tmp/test/ibrahimucar/ -rwxrwxr-x 1 ibrahim ibrahim 67 Nov 6 04:37 ​ test.txt If we want to remove the package which is installed into the system. We can use the following commands. Then you can look at the ​/tmp/test/ibrahimucar​ directory and you can see that there is no such like this file. root# ​dpkg -r test.1.2.3 ( Reading database ... 130889 files and directories currently installed.) Preparing to unpack test.1.2.3.deb ... Unpacking test (1.4.2) ... Setting up test (1.4.2) … root# ​ls -alh /tmp/test/ibrahimucar/ ls: cannot access /tmp/test/ibrahimucar/: No such file or directory
  • 16. Displaying The Directory Structure After all the process are finished, we can use the following command if we want to see the directory structure. root# ​tree test ├── DEBIAN │ ├── conffiles │ ├── control │ ├── postinst │ └── prerm └── tmp └── file.tar.gz 2 directories, 5 files About The Author Author: İbrahim UÇAR First Published Date: 16.01.2017 Contact Information; ➔ ucribrahim@gmail.com ➔ twitter.com/ucribrahim ➔ lifeoverlinux.com