Linux How to Create Multiboot on several Linux distros To be able to create an automatic installation file on a device …

To create an automatic installation file on a Linux device or some of its variants. We will need certain knowledge, because it is different from other operating systems. Next, we will explain how to develop an installable file in .deb format.

Executable Files with DEB Packages on Linux Derivatives, Ubuntu – Debian – Mint

If we want to distribute an application on Linux and that is based on Debian, we will have to package it in .deb format. Which is the type of format attributed to Debian packages. Now, the only question we should know before starting our project is that .deb packages do not install external resources.

So, if we want or need to install an external database, it would be much more advisable to use another server. How could the service of MySQL, which with its particularity of SQLITE Allows you to install external databases on the system.

Let’s start then, in the Linux operating system, the executable files “sh“Are installed by default in the folder:”/ usr / bin”. But, this can be modified at the decision of the developer. In the same way, the executables also install their libraries in the folder: “/ usr / lib”. And the icon to be able to integrate the application menu in the folder: “/ usr / share / instalation-folder”.

Resulting in code syntax like this:

/usr/bin/application.sh -Executive script sh or run-/usr/lib/aplicación/aplicacíon.jar -jar java execution-/ usr / lib / application / libraries_ application.jar -various bookstores-/usr/share/doc/aplicación/icono.gif -java application icon-

Next, we will open a File Browser And of same away, we will create a new application folder. In addition, we have to bear in mind that said folder has to be easy to assign from our terminal. This with the intention of beginning to create our setup application structure.

We will create inside our application folder, another with the name: DEBIAN. And within it, we will create a new text file without any extension. We will name this file: “control”. Because this file will have the descriptions and specifications that will be shown to the user.

An example of the content of such a file could be as follows:

  • Package: Application
  • Version: 12,0
  • Section: Documentation
  • Priority: optional
  • Architecture: all
  • Maintainer: Pedro-Gonzales-JR <[email protected]>
  • Installed-Size: 171
  • Description: Whatever description we want to place on the package.

(In case you need more lines to explain the description of the package. Make sure that the beginning of each is represented by a space, because otherwise the application will detect it as another field).

The next step that we will carry out consists of copy all files that the application has compiled in which we work. Or in the case that it is a java application, we will have to copy the .jar file. And then we will place them in the folder: application / usr / lib / application

And then we will create a new item in the folder called: application / usr / bin. A text file that we will name: “app.sh”. With the bash script that we will teach below and that will be in charge of indicating the direction of the executable file:

#! / bin / bash

(Here is a blank space)

java -jar /usr/lib/app/app.jar

We continue by giving the execution permissions to our application with the command: chmod + x app.sh And in the same way, we will assign an icon to the application, placing it inside the folder: app / usr / share / hello-world.

To continue with the creation of our executable file, we will create a file with the specific characteristics installation. This will have to be inside the folder: application / usr / share / applications. We will call it “application”And we will place inside:

[Desktop Entry]

Encoding = UTF-8

Name = Application

Comment = (Comments about our application)

Exec = / usr / bin / application

Icon = / usr / share / application.png

Terminal = false

Type = Application

Categories = Education; Documentation; Other

StartupNotify = true

And now, the final product of our creation can be viewed by us in the terminal. And our .deb file has become a full installer and fully functional. Being able to share it with other people or Linux users who wish to obtain our product.