Does AppImage include all shared library dependencies by default?

Hi,

I want to use AppImage to create an image of my program that behaves exactly like a fully statically linked binary that will run on any Linux distribution.

I use the following command to build an AppImage of my application:

appimagetool-x86_64.AppImage AppDir/

Do I need to manually copy all of my programs shared libraries to AppDir/usr/lib using e.g.:

cp $(ldd AppDir/usr/bin/my_app | grep -o ‘\W/[^ ]*’) AppDir/usr/lib

Or does AppImage by default include all of the programs shared libraries?

Thanks!

appimagetool just puts the contents of your AppDir into an AppImage, unchanged.

You need to craft an AppDir that bundles everything, down to ld-linux.so.

I am doing it for https://github.com/probonopd/libhookexecv/releases, for example.

Thanks for your answer.

My application is a C++ Qt application and I have now found the linuxdeployqt tool (GitHub - probonopd/linuxdeployqt: Makes Linux applications self-contained by copying in the libraries and plugins that the application uses, and optionally generates an AppImage. Can be used for Qt and other applications) which automatically copies my program’s shared library dependencies into AppDir/usr/lib and then builds an AppImage of my program.

You need to craft an AppDir that bundles everything, down to ld-linux.so .

linuxdeployqt however does not include all shared libraries. I guess libuxdeployqt assumes that some shared libraries will always be installed on any Linux distribution and hence it does not include them.

Do you know if it is really necessary to include everything e.g. ld-linux.so, libpthread.so.0, libX11.so.6, …? I really don’t care if users cannot run my program on a 10 year old Linux PC. (Note that I have manually added e.g. libgcc.so.6 and libstdc++.so.6 because I know these are missing on 5 year old Linux distributions).

linuxdeployqt will not bundle everything. Generally we recommend to build on the oldest still-supported distribution release (e.g., currently Ubuntu 14.04 trusty), and not bundle these libraries. This is what linuxdeployqt does.

Thanks, both AppImage and linuxdeployqt are awesome :grinning:

1 Like

No offense.

The AppImage doc is not helpful. I lost interest to package mine by reading the doc.

Even the basic function like packaging the shared library automatically still required human intervention.

I don’t find these packaging tools awesome at all.

Welcome @rickyzhang82. Which application are you trying to package, and what exactly do you find too complicated? For many applications, you can just basically copy&paste https://github.com/probonopd/linuxdeployqt/#using-linuxdeployqt-with-travis-ci with very few changes.