Run the latest Emacs, even when your OS doesn’t provide one: Introducing Flatpak

When you are an ardent fan of Emacs, you would want to use the very latest Emacs.  But you wouldn’t be able to do so just because your OS vendor hasn’t come around to packaging it for you.

For example, I run the very latest Debian i.e., Debian Unstable.  Inspite of that, I am stuck at using Emacs 25.2.2, when I could be running Emacs 26.1.

Given this handicap, you might want to consider using Flatpak (1).  The Flatpak project describes itself as

Flatpak is a next-generation technology for building and distributing desktop applications on Linux

True to it’s mission, the Flatpak project distributes the very latest Emacs.(1)

Step 1: Install Flatpak

Setup Flatpak for your specific distribution (1).

If you are running Debian, open a terminal and run the following commands

$ sudo apt install flatpak
$ sudo apt install gnome-software-plugin-flatpak
$ sudo flatpak remote-add --if-not-exists flathub
$ sudo flatpak update

Note 1: At the time of writing this article, I had trouble running the second of the above commands.  This is presumably because of the ongoing migration to Perl 5.28.(1).  It appears that you can skip the second step altogether, and yet not compromise your ability to install Emacs 26.1.

Step 2: Install GNU Emacs

Check the availability of GNU Emacs with

$ flatpak search emacs

You should see an output like this

$ flatpak search emacs
Application ID    Version Branch Remotes Description                                                  
org.gnu.emacs     26.1    stable flathub An extensible text editor                                    
org.gnome.Devhelp         stable flathub A developer tool for browsing and searching API documentation

If the above search fails, update the list of flathub packages with

$ sudo flatpak update

and try again.

Now install GNU Emacs with

$ sudo flatpak install flathub org.gnu.emacs

If you are installing Emacs for the first time, the above command installs GNOME runtime for you.  Note that the runtime is a very sizable download.

Step 3: Run Emacs

You can  run Emacs with

$ flatpak run org.gnu.emacs

Step 4: Check your Emacs features

Before relying on your flathub Emacs, you may want to check it’s features against the features of your distribution-specific Emacs.   You can check the capabilities of your Emacs by examining the variable system-configuration-features or by M-x report-emacs-bug RET(1).

At the time of  writing, the flathub Emacs

  1. has no support for GPM or IMAGEMAGICK
  2. lacks support for LIBOTF and M17N_FLT
  3. doesn’t support XWIDGETS

Item (2) above means that you may have trouble when editing in Indic, Khmer,  Arabic and Farsi.(1) Item (3) is acceptable because it is felt that this feature compromises security(1)

sh-4.4$ diff -u debian-emacs-25.2.2-features.txt flathub-emacs-26.1-features.txt
--- debian-emacs-25.2.2-features.txt    2018-11-05 13:20:10.453834977 +0530
+++ flathub-emacs-26.1-features.txt 2018-11-05 13:21:42.345884892 +0530
@@ -3,16 +3,12 @@
@@ -23,5 +19,4 @@

Concluding Words

The flatpak is a blessing in disguise for those are desperate to run the very latest Emacs.  The flathub Emacs lacks support for some crucial features like IMAGEMAGICK , CTL etc. These issues(1) could be addressed by working with flatpak maintainers.  Flatpak eco-system is in it’s infancy(1), and it has fair share of supporters and detractors.  That said, I am excited about flatpak, mostly because it allows me to use the very latest Emacs, and I need no longer be solely at the mercy of my OS vendor.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your 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

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close