AppImage

Does AppImage include all shared library dependencies by default?


#1

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!


#2

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.


#3

Thanks for your answer.

My application is a C++ Qt application and I have now found the linuxdeployqt tool (https://github.com/probonopd/linuxdeployqt) 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).


#4

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.


#5

Thanks, both AppImage and linuxdeployqt are awesome :grinning: