I have made a game and I want to make debian installer for Ubuntu. Could you reccomend me app, that allows me to make directory and save my game data in it, than packs it in .deb. Most important, so after install, it adds shortcut in Unity dash and side bar. Please, reccomend me a good, free software to make this.
-
1If you never made a `.deb` file before, this is an easy start: http://ubuntuforums.org/showthread.php?t=910717 t. A `.desktop` file, you will have to make yourself (tons of posts about that here) and include in the directory to install. – Jacob Vlijm Dec 31 '14 at 22:14
-
OK! It looks hopeful, when I get my own computer. But does that package install shortcut in Dash and does where does it builid .deb file? – Adrians Netlis Dec 31 '14 at 22:30
-
The .deb is created in the same directory as your "scaled" directory. The `.desktop` file, you should store in `/usr/share/applications` (inside your scaled directory). That will make the application available in Dash. The principle of a debian package is that it is a scaled version of your system, "projected" on your system on install. Look into a .deb file (with archive manager), you will see all files in the directories where they will be installed. – Jacob Vlijm Dec 31 '14 at 22:35
-
I'll be happy to make an answer here, based on an edited version of the comments, but it is locally 15 minutes before 2015 here now :), need to join in the champagne :). – Jacob Vlijm Dec 31 '14 at 22:49
-
It is 2015 now and it shows 00:51 now:D – Adrians Netlis Dec 31 '14 at 22:51
-
Here... In Latvia... – Adrians Netlis Dec 31 '14 at 23:18
-
See the link: http://askubuntu.com/questions/1345/what-is-the-simplest-debian-packaging-guide – Muzaffar Jan 01 '15 at 00:28
1 Answers
There is a lot to say about (creating) Debian packages, and information can be overwhelming.
The example below is to make the (very) first start, and create a Debian installer, as basic as it possibly gets, suited for "home" purposes.
Debian packages
A Debian package is in principle a scaled version of your system, seen from the perspective of the root directory. Directories are exactly organized like on your computer.
Looking inside a .deb installer file with archive manager, you can see where files and (possibly) directories will be installed:

In this example, files will be installed in /etc, /usr and /opt (the folder DEBIAN contains installation files, see further below)
Browsing deeper into /usr, you can see the .desktop file (represening your application in Dash) is installed in /usr/share/applications/

When an application is installed, the contents of this scaled version is "projected" on to your "real" system.
A simple example; create a first installer
Say you have a small application (script in this case), that you want to install into the directory /opt, together with its application icon. To represent the applications in Dash, you will also need a .desktop file.
Our example application will only show you a window, saying you succeeded:

The "application":
Copy the script below into an empty file, save it as
ididit(don't use theshextension)#!/bin/sh zenity --info --text 'It seems you succeeded making your first Debian installer...'The icon:
Simply download the icon below as
ididit.png
The
.desktopfile[Desktop Entry] Name=I did it! Exec=/opt/ididit/ididit Icon=/opt/ididit/ididit.png Type=ApplicationCopy it and save it as
ididit.desktop
Now create the scaled directory:
- Create an empty project folder somehwere, named (e.g.)
ididit_1.0-1 Inside this project folder, create the directories:
/opt/ididit /usr/share/applications /DEBIANThe last directory will not be installed, but contains files, needed by the package manager (see further below).
Copy both your script, named
ididit(noshextension), and the icon, namedididtit.pnginto your newly created directory:[.../ididit_1.0-1] /opt/ididitMake the script executable.
Copy the
.desktopfile into the directory:[.../ididit_1.0-1] /usr/share/applicationsThe
/DEBIANdirectory contains files, used by the package manager. It can contain a varying number of files, postinst scripts etc. (look here and here for more information). Since this is meant to be an example as simple as possible, we'll keep it to just one necessary (minimized) file: the control file:Package: ididit Version: 1.0-1 Section: unknown Architecture: amd64 Depends: zenity Maintainer: Your Name <your_email> Description: This is my first Debian installer.Copy it into an empty file, save it as
controlin theDEBIANfolder.note: replace
Architecture: amd64byArchitecture: i386if you use 32bit.Run the following command to make your first installer:
dpkg-deb --build /path/to/ididit_1.0-1The Debian installer will be created in the same directory as your project folder.
Now you can install it by:
sudo dpkg -i <package>
And uninstall it by:
sudo dpkg -r <package>
If all went well, you can run it from Dash.

If you install it by Software Center, it will complain about the "bad quality" of the package, since we skipped a number of files etc. To see exactly what the complaints are, you can run in a terminal:
lintian /path/to/package
As mentioned, this is only a small instruction on how to make a first working Debian installer. It might encourage you to develop your skills further into creating lintian- proof Debian installers.
More to read: Ubuntu packaging guide (and many, many other sources.)
- 82,471
- 12
- 195
- 299
-
Thanks! This answer looks helpful. I will test it as soon as I can, but it appears really working. Thanks!:) – Adrians Netlis Jan 01 '15 at 18:43
-
-
-
-
-
-
-
@AdriansNetlis really no offence, but why ask a question if you don't have time to try it out (ever). I'd really prefer you to say it doesn't work, or you don't like it, than writing an answer that is never looked into. – Jacob Vlijm Feb 01 '15 at 18:02
-
Well... I can't test it as I haven't got my own computer yet, I am trying to get money, but it comes very, very hard... – Adrians Netlis Feb 01 '15 at 19:57