I developed a java application which is packaged for many platfor (including .deb / .rpm). In my app, there is a functionality to auto-upgrade. For Linux platform, it manages, to check if new version exist and to download the new .deb/.rpm. Now I have 2 options:

  1. a popup asking the user to close the app and to install the .deb/.rpm himself
  2. launch a script which close the app and install the .deb / .rpm itseld (similar to what is done under Windows and MacOS).

Is it possible to have a safe approach 2 for all debian/fedora derivatives? For example would a script as the following a good idea for Debian derivatives?

sudo apt install gdebi -y
sudo gdbi [package path]

Thank you for your help.

  • I would consider consider distributing your application as Flatpack and put it on Flathub flathub.org/home This way it will become available on any Linux and update is one single command.
    – msuchy
    Aug 2, 2020 at 9:11

1 Answer 1


When distributing packages, the recommended approach is to make them available in package repositories (either your own, or one of the various community repositories); that way, upgrades are handled with the rest of the system’s upgrades. In current desktop environments, users are notified when updates are available, so you won’t add much delay compared to a specific check in your application.

It is however possible to handle your own upgrades. Depending on how your application is packaged, it might not even be necessary to close it before upgrading — Unix-style environments don’t prevent you from changing an executable when it’s running.

As far as your installation snippet for Debian and derivatives go, I wouldn’t bother with gdebi; apt can install local packages by itself. Download the package, then in the same directory, run

sudo apt install ./package.deb

As long as you start the path with ./, apt will use the downloaded package (and resolve dependencies etc.).

You can do the same for Fedora- or RHEL-based RPM systems, with yum or dnf.

  • ok thank you I will try simply with apt instead of gdebi. For my info (I am a Windows user), I imagine making my software available in package manager will not be as easy as uploading my .deb on a server, right? If it is not too much an effort I would consider it but otherwise I would stick with the .deb distribution ....
    – akasolace
    Jul 31, 2020 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .