# Does AppImage include all shared library dependencies by default?

**URL:** <https://discourse.appimage.org/t/does-appimage-include-all-shared-library-dependencies-by-default/509>\
**Category:** Creating AppImages\
**Created:** [January 4, 2019, 10:29am UTC](https://discourse.appimage.org/t/does-appimage-include-all-shared-library-dependencies-by-default/509 "2019-01-04T10:29:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimwalisch](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/kimwalisch/32/206_2.png) [@kimwalisch](https://discourse.appimage.org/u/kimwalisch)\
**Post date:** [January 4, 2019, 10:29am UTC](https://discourse.appimage.org/t/does-appimage-include-all-shared-library-dependencies-by-default/509/1 "2019-01-04T10:29:47Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![probono](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/probono/32/81_2.png) [@probono](https://discourse.appimage.org/u/probono)\
**Post date:** [January 4, 2019, 12:48pm UTC](https://discourse.appimage.org/t/does-appimage-include-all-shared-library-dependencies-by-default/509/2 "2019-01-04T12:48:10Z")

</div>

`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](https://github.com/probonopd/libhookexecv/releases), for example.

---

<div class="post-metadata">

**Author:** ![kimwalisch](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/kimwalisch/32/206_2.png) [@kimwalisch](https://discourse.appimage.org/u/kimwalisch)\
**Post date:** [January 4, 2019, 12:58pm UTC](https://discourse.appimage.org/t/does-appimage-include-all-shared-library-dependencies-by-default/509/3 "2019-01-04T12:58:09Z")

</div>

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](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).

---

<div class="post-metadata">

**Author:** ![probono](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/probono/32/81_2.png) [@probono](https://discourse.appimage.org/u/probono)\
**Post date:** [January 5, 2019, 2:02pm UTC](https://discourse.appimage.org/t/does-appimage-include-all-shared-library-dependencies-by-default/509/4 "2019-01-05T14:02:15Z")

</div>

`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](https://github.com/AppImage/pkg2appimage/blob/master/excludelist#L18) libraries. This is what `linuxdeployqt` does.

---

<div class="post-metadata">

**Author:** ![kimwalisch](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/kimwalisch/32/206_2.png) [@kimwalisch](https://discourse.appimage.org/u/kimwalisch)\
**Post date:** [January 5, 2019, 6:42pm UTC](https://discourse.appimage.org/t/does-appimage-include-all-shared-library-dependencies-by-default/509/5 "2019-01-05T18:42:47Z")

</div>

Thanks, both AppImage and linuxdeployqt are awesome 😀

---

<div class="post-metadata">

**Author:** ![rickyzhang82](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/rickyzhang82/32/251_2.png) [@rickyzhang82](https://discourse.appimage.org/u/rickyzhang82)\
**Post date:** [May 18, 2019, 2:23am UTC](https://discourse.appimage.org/t/does-appimage-include-all-shared-library-dependencies-by-default/509/6 "2019-05-18T02:23:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![probono](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/probono/32/81_2.png) [@probono](https://discourse.appimage.org/u/probono)\
**Post date:** [May 23, 2019, 5:11pm UTC](https://discourse.appimage.org/t/does-appimage-include-all-shared-library-dependencies-by-default/509/7 "2019-05-23T17:11:11Z")

</div>

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](https://github.com/probonopd/linuxdeployqt/#using-linuxdeployqt-with-travis-ci) with very few changes.
