Creating Ubuntu debian pakage


You can check any debian package to get an idea about what goes inside the package.

.deb file can be opened in Linux with Archive manager. Actually .deb is just a zip.

There are two important directories:


and usrin general can have other directories or may not have usr directory.

Screen Shot 2017-07-02 at 5.21.45 PM

myApplication inside /usr/local/bin contains all the executable and .so etc related to my application.

You can literally see into any .deb file and get to know what kind of content is inside each of the files in DEBIAN directory.

control file


Package: myApplication
Version: 1.1.0
Section: admin
Priority: optional
Installed-Size: 415000
Architecture: amd64
Maintainer: Company name 
Description: Blah blah .. blah software..






#This installer installs myApplication

#give permission to startup script for IntelliSpace
chmod 755 /usr/local/bin/myApplication/

#create application entry for IntelliSpace

echo "
#!/usr/bin/env xdg-open

[Desktop Entry]
Comment=blah blah blah
" > /usr/share/applications/myApplication.desktop

xdg-desktop-menu install --novendor /usr/share/applications/myApplication.desktop

#Creating desktop icons
for user in /home/*
cp /usr/share/applications/myApplication.desktop ${user}/Desktop/
chmod 777 ${user}//Desktop/myApplication.desktop

cd /usr/local/bin/myApplication
chmod -R 777 *




#remove myApplication startup
rm /usr/local/bin/myApplication/

#delete all configurations
#rm -rf ~/.local/share/calibs #wrong folder
#uninstall application entry
xdg-desktop-menu uninstall usr/share/applications/myApplication.desktop


The file names are descriptive I think. prerm this will be run when application will be removed so for cleaning. postinst will run at time of installation when all your files are copied and dependencies installed.

md5sums is created when package is created you do not have to worry for this.


Command to create package:


fakeroot dpkg-deb --build myApplication

where myApplication is the name of folder which has all the content.


You may need to install dpkg-deb


To test either double click and install the .deb file created in above step by Ubuntu Software center or use below command

sudo dpkg -i myApplication.deb



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s