How can I examine the files inside an Appimage?
Without changing their extension:
As such, an appimage can be mounted or extracted. That is:
To mount them:
my.AppImage --appimage-mount
The AppImage is unmounted when the application called in the example is interrupted (e.g., by pressing Ctrl+C, closing the terminal etc.).
Note: This is only available for type 2 AppImages. Type 1 AppImages do not provide any self-mounting mechanism. To mount type 1 AppImages, use
mount -o loop
To extract them:
An alternative to mounting the AppImages is to extract their contents. This allows for modifying the contents. The resulting directory is a valid AppDir, and users can create AppImages from them again using
appimagetool
.Analog to mounting AppImages, there is a simple commandline switch to extract the contents of type 2 AppImages without external tools. Just call the AppImage with the parameter
--appimage-extract
. This will cause the runtime to create a new directory calledsquashfs-root
, containing the contents of the AppImage’s AppDir specification.Type 1 AppImages require the deprecated tool
AppImageExtract
to extract the contents of an AppImage. It’s very limited functionality wise, and requires a GUI to run. It creates a new directory in the user’s desktop directory.
There is an answer on superuser on how to extract files from an AppImage.
Looking at my appimages I see that only some of them can be mounted with gnome-disk-image-mounter. Also here.
Changing their extension:
Not all appimages have exactly the same structure, but all are archives. Wikipedia says: "An AppImage of version 1.0 is an ISO 9660 Rock Ridge file (which can be optionally zisofs compressed) containing a minimal AppDir and a tiny runtime. (Version 2 may use other file system image formats like SquashFS)".
So, it can be extracted. In this way you can examine the files.
Simply changing the extension from AppImage
to an archive extension that my file-roller archive manager can read (I tested with zip
, 7z
, etc) and double-clicking the file reveals the contents in file-roller:
They can also be extracted, of course. The "extract" file manager context menu action works too in order to extract the archive. (As said in comment, the unzip
command reports an error with a file renamed with a zip
extension, so renaming to zip
is not the proper choice in itself, but it works with archive managers like file-roller
.)
According to AppImage documentation the --appimage-mount
option allows you to mount and inspect the contents.
For example:
./Joplin.AppImage --appimage-mount /tmp/mount_myXXXX
The application's help can usually be shown with ./whatever.AppImage --help
like any other application, but to see the AppImage specific options, you can run:
./whatever.AppImage --appimage-help
Here is the relevant portion of the output:
AppImage options:
...
--appimage-mount Mount embedded filesystem image and print
mount point and wait for kill with Ctrl-C
You don't have to create a mountpoint for it or delete the directory afterwards; the AppImage will take care of all of that.