This document explains how to create a Debian (.deb) package from source code or manually on a Linux system. It covers topics such as package types, dependencies, tools for creating packages, package files and structure, and testing packages. Key steps include installing package creation tools, compiling an application from source, and using tools like checkinstall or debmake to convert it to a .deb package. Manual package creation involves creating package files and directories, writing installation scripts, and building the package. The document provides examples to create packages for the bzip2 tool from source and manually for a test package.
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
The Linux command line is a powerful tool. The majority of webservers run on Linux/Unix. Some hosting companies offer SSH access to their hosting environment. Via SSH you can login and use the Linux command line.
In this presentation, Peter will show you some time-saving command line commands that you can use for certain tasks on your Joomla websites:
some basic SSH command line commands
Analyzing & recovering a hacked website
Backup a website or move it to another server
Finding unused files
Setting up a test environment
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...Edureka!
This Linux training will take you one step closer to becoming a Linux administrator. The most common and important tasks that a Linux admin is responsible for, is covered in this Linux training video. Below are the topics covered in this tutorial:
1) Linux File Permissions
2) ACLs (Access Control Lists)
3) Shell Scripting
4) Patching In Linux
5) Networking In Linux:-
a) SSH For Remote Host Access
b) SFTP For Remote File Transfer
c) SCP For Remote Folder Transfer
Part 6 of "Introduction to linux for bioinformatics": Productivity tipsJoachim Jacob
This is part 6 of the training "Introduction to linux for bioinformatics". Here we show basic tips to become rapidly more efficient on the command line. Interested in following this training session? Please contact me at http://www.jakonix.be/contact.html
linux-commandline-magic-Joomla-World-Conference-2014Peter Martin
The Linux command line is a powerful tool. The majority of webservers run on Linux/Unix. Some hosting companies offer SSH access to their hosting environment. Via SSH you can login and use the Linux command line.
In this presentation, Peter will show you some time-saving command line commands that you can use for certain tasks on your Joomla websites:
some basic SSH command line commands
Analyzing & recovering a hacked website
Backup a website or move it to another server
Finding unused files
Setting up a test environment
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...Edureka!
This Linux training will take you one step closer to becoming a Linux administrator. The most common and important tasks that a Linux admin is responsible for, is covered in this Linux training video. Below are the topics covered in this tutorial:
1) Linux File Permissions
2) ACLs (Access Control Lists)
3) Shell Scripting
4) Patching In Linux
5) Networking In Linux:-
a) SSH For Remote Host Access
b) SFTP For Remote File Transfer
c) SCP For Remote Folder Transfer
Part 6 of "Introduction to linux for bioinformatics": Productivity tipsJoachim Jacob
This is part 6 of the training "Introduction to linux for bioinformatics". Here we show basic tips to become rapidly more efficient on the command line. Interested in following this training session? Please contact me at http://www.jakonix.be/contact.html
Linux Yaz Kampı 2016 pfSense Firewall ve Router Eğitim Dökümanıİbrahim UÇAR
Bu eğitim dökümanı pfSense 2.2.6 kurulumu/yapılandırması, filtrelenmesi, dhcp, dns, vpn gibi temel servislerinin ne işe yaradıkları ve nasıl yapılandırılacağı gibi konuların işleneceği bir eğitimdir.
Gulfinity is Classifieds company based in Qatar provides you infinite opportunities to find jobs, job seekers, courses, Institutes all over Middle East . You can find jobs and job seekers in different categories like professional and Non-professionals.
LA HISTORIA CLÍNICA ES UN DOCUMENTO MEDICO OBSTETRICO LEGAL, EN QUE SE REGISTRA DATOS RELACIONADOS AL PASADO, PRESENTE Y FUTURO DE LA PERSONA QUE SE ATIENDE EL LOS ESTABLECIMIENTOS DE SALUD DEL PRIMER NIVEL Y HOSPITALES DEL II Y III NIVEL DE ATENCIÓN DE SALUD. EL USO ES OBLIGATORIO Y NECESARIO POR QUE PERMITE SISTEMATIZAR, ORDENAR, INTERPRETAR, ANALIZAR EN CADA UNA DE SUS PARTES Y SUB PARTES.
This tutorial is an introduction to Debian packaging. It teaches prospective developers how to modify existing packages, how to create their own packages, and how to interact with the Debian community. In addition to the main tutorial, it includes three practical sessions on modifying the 'grep' package, and packaging the 'gnujump' game and a Java library.
Images of 1st, 2nd and 6th belong to DreamWorks Animation
Image of K Computer belongs to Fujitsu.
Presentation made not for commercial use, but educational.
Nuget is easier than you think and you should be using it as both a consumer ...Justin James
Nuget is a package manager for Visual Studio that allows you to easily share assets (dll, javascript, c#, etc files) and use them in your project. Most Visual Studio developers have consumer nuget packages but few have created and shared nuget packages. It is amazingly easy to create and publish a nuget package. In less than 60 minutes I will show you how move from a consumer to a creator. You will learn how to package up dll's, source code that needs to be inserted in a project, add/change configurations, publish a package and host your own nuget feed.
This lecture discusses the different techniques used to install, uninstall and upgrade software packages in Linux and the associated tools
Video for this lecture on youtube:
http://www.youtube.com/watch?v=pFqdupd9wKk
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
Ahmed ElArabawy
- https://www.linkedin.com/in/ahmedelarabawy
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesSanjeev Rampal
Talk presented at Kubernetes Community Day, New York, May 2024.
Technical summary of Multi-Cluster Kubernetes Networking architectures with focus on 4 key topics.
1) Key patterns for Multi-cluster architectures
2) Architectural comparison of several OSS/ CNCF projects to address these patterns
3) Evolution trends for the APIs of these projects
4) Some design recommendations & guidelines for adopting/ deploying these solutions.
1.Wireless Communication System_Wireless communication is a broad term that i...JeyaPerumal1
Wireless communication involves the transmission of information over a distance without the help of wires, cables or any other forms of electrical conductors.
Wireless communication is a broad term that incorporates all procedures and forms of connecting and communicating between two or more devices using a wireless signal through wireless communication technologies and devices.
Features of Wireless Communication
The evolution of wireless technology has brought many advancements with its effective features.
The transmitted distance can be anywhere between a few meters (for example, a television's remote control) and thousands of kilometers (for example, radio communication).
Wireless communication can be used for cellular telephony, wireless access to the internet, wireless home networking, and so on.
This 7-second Brain Wave Ritual Attracts Money To You.!nirahealhty
Discover the power of a simple 7-second brain wave ritual that can attract wealth and abundance into your life. By tapping into specific brain frequencies, this technique helps you manifest financial success effortlessly. Ready to transform your financial future? Try this powerful ritual and start attracting money today!
ER(Entity Relationship) Diagram for online shopping - TAEHimani415946
https://bit.ly/3KACoyV
The ER diagram for the project is the foundation for the building of the database of the project. The properties, datatypes, and attributes are defined by the ER diagram.
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