Submit A Tip Alternative Tip Form

Distro Agnostic packaging: Making AppImages

Welcome to the world of Distro agnostic application packaging thanks to the ‘1 app = 1 file’ AppImage initiative from the Elementary-Project.

Yesterday we waxed lyrical about the ‘portability’ factor of AppImages – the one-click self-contained applications that can run from any location and on any distribution.

Today we’re going to look a bit deeper at what they really are, how they work and how you can package up your favourite application as a one-click distro-agnostic AppImage.

Why AppImages?

Why not? By being self-contained one-click solutions that can run on multiple distributions without requiring the installation of anything else they provide an easy solution to the headache of packaging applications in so many various formats. 1 app = 1 file = any os.

Better yet AppImages don’t require administrative privileges in order to run. This makes AppImages a safe and secure way to not only try out the latest version of software without damaging any locally installed versions but also afford users a greater level of security as they are unable to affect the file system as a whole.

As AppImage’s can be run from anywhere users are able to store them wherever they like: a dedicated folder in their home drive, a USB drive, even a network share! Better yet you won’t find excess libraries or cruft left behind when you move or delete them – just delete and it’s gone.

What is an AppImage?

So what is an AppImage? Dan Rabbit over on the Elementary-Project wiki explains it pretty well: -

“When you run an AppImage, you are really mounting a virtual filesystem on top of your actual filesystem via fuse. The AppRun script ties the two together so that the AppImage will use libraries and other resources from your system.“

“Just like any other application, an AppImage will store its configuration data in your home folder. It’ll even use your same configuration data from previous installations of that application.”

Make an AppImage from a .deb

So now you know why they’re good you probably want to have a go at packaging one. Be aware that the packaging method isn’t flawless and isn’t guaranteed to work with every application so don’t be too disappointed if your attempt doesn’t work.

We’ll start easy – here’s how to make an AppImage by simply repackaging a .deb file.

  1. Right click on the .deb file of the application you wish to package and ‘extract’
  2. Add “.appdir” to the end of the resulting extract folder name
  3. Inside the folder find find and extract  the ‘data.tar.gz’ archive
  4. Delete the remaining archives so you’re left with the extracted ‘data’ folder.
  5. Copy the .desktop file from usr/share/applications to the AppDir’s root.
  6. Copy the application’s icon from /usr/share/icons/ to the AppDir’s root.
  7. Download the AppRun script and place it in the AppDir’s root.

Next we will take the AppDir and package it into the one-click AppImage using the AppImageAssistant

  1. Download the AppImageAssistant from here and run.
  2. When opened, click on the ‘Forward’ button and locate your AppDir
  3. Click ‘Forward’ once again
  4. Profit

Head over the Elementary-Project wiki for the full LD on creating AppDir’s from scratch. Dan explains it very simply so even the easily confused will be creating AppImages in no time.

Thanks to Dan Rabbit & probono