pkg2appimage: An Open Source Tool to Convert DEB Packages into Portable AppImages

pkg2appimage: An Open Source Tool to Convert DEB Packages into Portable AppImages
This article is available in Arabic اقرأ بالعربية

The Problem of Application Compatibility Across Linux Distributions

One of the biggest challenges facing Linux users is the diversity of distributions and their different package management systems. What works on Ubuntu may not work on Fedora, and vice versa. Developers need to package their applications in multiple formats to ensure they reach the largest possible user base.

AppImage was created to solve this problem, offering a portable application format that runs on any Linux distribution without installation or root privileges. However, not all developers produce their applications as AppImages directly. This is where the pkg2appimage tool comes in.

🔗 Official Repository: github.com/AppImageCommunity/pkg2appimage

What is pkg2appimage?

pkg2appimage is an open source tool, developed by the AppImage community, that allows converting existing DEB packages or binary archives into portable AppImages. The tool uses YAML recipe files that specify where to obtain the components and how to convert them into an AppImage.

The core idea is that if an application is available as a DEB package, you can use pkg2appimage to create an AppImage from it, without needing access to the original source code.

How to Use It

Building an AppImage from an Existing Recipe

If there is a ready-made .yml recipe file for the application you want, you can simply use the application name as an argument:

# Download the pkg2appimage tool as an AppImage
wget -c $(wget -q https://api.github.com/repos/AppImageCommunity/pkg2appimage/releases -O - | grep "pkg2appimage-.*-x86_64.AppImage" | grep browser_download_url | head -n 1 | cut -d '"' -f 4)
chmod +x ./pkg2appimage-*.AppImage

# Run the tool with the application name (e.g., Spotify)
./pkg2appimage-*.AppImage Spotify

This command will look for a Spotify.yml file in the recipes folder, download the required components, and build an AppImage.

Building an AppImage from a Local Recipe

If you are developing a new recipe or want to modify an existing one, you can run pkg2appimage with the specific recipe file path:

./pkg2appimage-*.AppImage recipes/XXX.yml

How Do Recipes Work?

The .yml recipe files tell pkg2appimage where to get the components and how to convert them into an AppImage. They contain information such as:

  • Application name and version.
  • Package source (DEB download link, PPA, or binary archive).
  • Dependencies that must be included in the AppImage.
  • Files to exclude.
  • Post-installation commands.

Studying the examples in the recipes/ folder is the best way to understand how they work.

Why is pkg2appimage an Important Tool?

For Developers

If you are a developer producing an application for Linux, you can use pkg2appimage to provide an AppImage version of your application with minimal effort. This expands your user base to include users of any distribution, without needing to maintain multiple packages.

For Users

If there is an application you like but it is only available as a DEB package for a specific distribution, you can use pkg2appimage with an appropriate recipe to create an AppImage yourself and run it on your distribution without installation.

For the Community

pkg2appimage encourages sharing recipes, allowing the community to maintain AppImage versions of applications that are not officially provided by their developers.

Limitations and Considerations

  • Dependence on existing packages: pkg2appimage does not build the application from source. It repackages an existing DEB package or binary archive. If the original package has bugs, they will carry over to the resulting AppImage.
  • Licensing: You must ensure that the application’s license allows redistribution in this way. Some proprietary applications do not permit redistribution.
  • Dependencies: All necessary dependencies must be included in the recipe to ensure the application works on all distributions.

Examples of Applications Converted Using pkg2appimage

  • Spotify: An AppImage can be created for Spotify using an existing recipe.
  • Neovim: A recipe for Neovim was added in January 2025.
  • Many other applications are available through the growing collection of recipes in the repository.

Contributing to the Project

The AppImage community welcomes contributions. You can:

  • Add new recipes for applications that do not yet have recipes.
  • Improve existing recipes to update versions or fix issues.
  • Develop the tool itself (pkg2appimage).

You can join the AppImage forum at discourse.appimage.org or the #AppImage IRC channel on irc.libera.chat.

Summary

pkg2appimage is a vital tool in the AppImage ecosystem. It bridges the gap between applications packaged as DEB packages and the portable AppImage format, making it easier for users to run applications on any Linux distribution and helping developers expand their application’s reach.

https://github.com/AppImageCommunity/pkg2appimage

https://appimage.org

https://discourse.appimage.org

Published in the Free and Open Source Software section – Packaging and Distribution Tools ```

Reactions & Comments

Sign in with GitHub to leave a comment or react. Powered by Giscus (stored in GitHub Discussions)

AR