How to implement auto-update of an electronic application in Linux?

I use an electron to create a cross-platform application. For Windows and Mac, this can be done using electronic tools such as autoUpdate, Squirrel and so on.

The problem is only with Linux. I created a .deb package for Ubuntu. But I can not find a "step by step" instruction or comprehensive information about it.

I am not familiar with Java and had no experience creating Linux applications.

So, the main questions are:

  1. What is the standard auto-update process using the distribution package manager? Who should do, download and install the update and restart the application.
  2. What are other ways to solve the problem. What is the best practice for creating custom updates?
  3. What are the differences between .deb, .rpm packages, and how are Ubuntu and Fedora different?

All information will be useful, even it (information) will not be associated with an electronic application.

+7
source share
4 answers

There is nothing standard in the * nix world. You will always maintain certain data, and each of these distributions may, in turn, have several possible ways to create automatic updates.

To your questions:

  • There is no standard way.

  • It depends on your way of actually distributing its package. If you plan to use package managers such as rpm / apt-get / apt install, each of these managers has a specific way to configure your application to be among those packages that are checked for automatic updates.

  • The difference between .rpm / .deb:

    The main difference for the accompanying package (I think it would be a β€œdeveloper” in Debian lingo) is the way the package metadata and the accompanying scripts are combined. Link

    The difference between Ubuntu and Fedora: since creating a detailed answer to these questions would be too long and too big to maintain, check out this blog post for a detailed description of the differences between the two distributions.

+5
source

The answer from Jens is really the best.

But if you don’t want to spend your time learning RPM and DEB and creating packages for all distributions, you can consider placing your application using Flatpak. http://flatpak.org/#about

Creates one large archive that can be run on Ubuntu, RHEL .... Everywhere.

+3
source

You can try electron-simple-updater if the AppImage format is right for your project.

+1
source

Appimages

You can use electron-builder to create applications to install or automatically update the application on almost any Linux distribution.

AppImage is a universal software package format. By packaging software in AppImage, the developer provides only one file to manage them all. The end user, that is, you, can use it in most (if not all) modern Linux distributions

If you want to automatically update your application, you will also need electron-autoupdater . Objectives:

  • MacOS: DMG.
  • Linux: AppImage
  • Windows: NSIS

You can find an example project that uses this here . Important files: package.json , updater.js , updater_renderer.js

Using some of these instructions, you can create installers:

 yarn electron-builder --linux --x64 yarn dist_linux # shortcut in package.json 

deb, rpm

You can create packages like deb or rpm using electron-builder , but automatically updating them depends on how you distribute them, as Jens says in his answer. The end user may need to add the apt repository to stay informed.

0
source

All Articles