I am concerned about the long-term stability of the pre-built bundle of Anki on Linux

I have been using the 2.0.47 pre-build Anki package since 2017, and surprisingly it has worked well all this time. This is surprising because the package is not entirely self-contained and pulls in some system libraries. If there were any changes to those libraries, such as API/ABI modifications or deprecation, the bundle would have failed.

The reason I have been using the old 2.0.47 version for so long is that there hasn’t been any compelling reason to upgrade until now. The new FSRS support is what finally prompted me to consider upgrading. When I attempted to run the anki-24.04beta1-linux-qt6 pre-build it immediately failed due to a missing libgssapi_krb5.so.2 library. I managed to get it to run after installing mit-krb5 from my distribution but I am unsure how long my distribution will continue to package that. The new versions of Anki rely even more on system libraries which brings with it an increased level of fragility.

By running Anki with LD_DEBUG=files and piping that into some bash magic I generated a list of distribution packages Anki depends on. The old 2.0.47 depends on 21 distribution packages and 24.04beta1 depends on 38.

  • Anki 2.0.47 depends on: dev-db/sqlite dev-libs/glib dev-libs/libxml2 media-libs/alsa-lib media-libs/fontconfig media-libs/freetype sys-apps/dbus sys-devel/gcc sys-libs/glibc sys-libs/zlib x11-libs/libICE x11-libs/libSM x11-libs/libX11 x11-libs/libXau x11-libs/libXcursor x11-libs/libXext x11-libs/libXfixes x11-libs/libXi x11-libs/libXinerama x11-libs/libXrandr x11-libs/libXrender

  • Anki 24.04beta1 depends on: app-accessibility/at-spi2-core app-arch/zstd app-crypt/mit-krb5 dev-libs/expat dev-libs/glib dev-libs/nspr dev-libs/nss media-libs/alsa-lib media-libs/fontconfig media-libs/freetype media-libs/libglvnd sys-apps/dbus sys-apps/systemd-utils sys-devel/gcc sys-libs/glibc sys-libs/zlib x11-libs/cairo x11-libs/gdk-pixbuf x11-libs/gtk+ x11-libs/libX11 x11-libs/libXcomposite x11-libs/libXdamage x11-libs/libXext x11-libs/libXfixes x11-libs/libXi x11-libs/libXrandr x11-libs/libXrender x11-libs/libXtst x11-libs/libdrm x11-libs/libxcb x11-libs/libxkbcommon x11-libs/libxkbfile x11-libs/libxshmfence x11-libs/pango x11-libs/xcb-util-cursor x11-libs/xcb-util-image x11-libs/xcb-util-keysyms x11-libs/xcb-util-renderutil x11-libs/xcb-util-wm

Is there anything that can be done to improve this situation? I have considered copying some of those system libraries into the Anki LD_LIBRARY_PATH but perhaps there is a good reason to keep them out of the bundle. The mit-krb5 library is security sensitive so I assume it was left out of the bundle so it can be quickly patched by the distribution if needed. I don’t use plugins, third-party decks, or the AnkiWeb synchronization functionality, so it does not matter if my old version of Anki has security vulnerabilities.

I generally prefer to use the distribution versions of the software I run but Anki is a special case. I had to start using the pre-built 2.0.47 version in 2017 due to distribution packaging problems during the 2.0 → 2.1 transition. There have been other problems since then related to the complex dependencies and build system of Anki and it does not look like that is going to improve anytime soon.

I have noticed that there is a Flatpak and a pip version available but I have never used either of those technologies. I assume the Flatpak version is self-contained by the nature of Flatpak but unfortunately it is not an official package but contributed by some unrelated third party. The pip version appears to be official but my minimal testing indicates that a Python virtual environment (venv) is not particularly self-contained. A venv is created with a copy of the Python interpreter but the main Python executable mainly acts as a thin wrapper around libpython which is not being copied. This means that whenever the current Python version is replaced with a new one the venv will fail due to missing libpython3.11.so.1.0.

If I want a (preferably trustworthy) version of Anki that is as self-contained and robust as possible, which version should I use?

If you want a completely isolated installation, you’ll need to use something like flatpak or docker. The Anki binaries include Qt, which dynamically links to GUI libraries on your system.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.