How I resolved Qt6 issues on install/update on Ubuntu 24 LTS

Anki 25.09 Installation and Qt Library Conflict Resolution

Just upgraded Anki from version 25.02 to 25.09 on Ubuntu 24.04 LTS and had to resolve Qt library conflicts that prevented the application from starting.

I suspect devs are aware of this issue based on the changelog, offering how I addressed it in case it helps with future patches. (AI helped me document and format the below but it tracks what I did pretty well.)

System

  • System: Ubuntu 24.04.3 LTS (Noble)
  • Initial Anki Version: 25.02 (working)
  • Target Version: 25.09
  • System Qt Version: 6.4.2
  • Required Qt Version: 6.9+

Standard Anki Installation Process

Followed official Anki documentation,

  1. added pre-install dependencies: sudo apt install libxcb-xinerama0 libxcb-cursor0 libnss3 zstd

  2. downloaded from apps.ankiweb.net

  3. extract and install:

    tar xaf Downloads/anki-2XXX-linux-qt6.tar.zst
    cd anki-2XXX-linux-qt6
    sudo ./install.sh
    

Problem: Qt Library Version Mismatch

Error Message:

ImportError: /usr/lib/x86_64-linux-gnu/libQt6DBus.so.6: undefined symbol:
_ZN9QtPrivate23CompatPropertySafePointC1EP14QBindingStatusP20QUntypedPropertyData, version Qt_6

Root Cause:

  • Anki 25.09 requires Qt 6.9+ libraries
  • Ubuntu 24.04 LTS only provides Qt 6.4.2 in its repositories
  • The new Anki launcher was attempting to use system Qt libraries instead of its bundled libraries

Versions:

  • System Qt version: libqt6core6t64: 6.4.2+dfsg-21.1build5
  • Anki’s bundled Qt version: 6.9+ (located in ~/.local/share/AnkiProgramFiles/.venv/lib/python3.13/site-packages/PyQt6/Qt6/lib/)
  • No official PPAs available for Qt 6.9 on Ubuntu 24.04

Solution

The issue occurs because Anki bundles its own Qt 6.9 libraries but defaults to using the system Qt 6.4 libraries. My quick fix was to create a wrapper script that forces Anki to use its bundled libraries.

  1. Create wrapper script:
mkdir -p ~/.local/bin
cat > ~/.local/bin/anki << 'EOF'
#!/bin/bash
export LD_LIBRARY_PATH="$HOME/.local/share/AnkiProgramFiles/.venv/lib/python3.13/site-packages/PyQt6/Qt6/lib:$LD_LIBRARY_PATH"
exec /usr/local/bin/anki "$@"
EOF
chmod +x ~/.local/bin/anki
  1. Refresh shell:
source ~/.bashrc  # or ~/.zshrc if using zsh

File Locations

  • System Launcher: /usr/local/bin/anki
  • Wrapper Script: ~/.local/bin/anki (the fix)
  • Bundled Qt Libraries: ~/.local/share/AnkiProgramFiles/.venv/lib/python3.13/site-packages/PyQt6/Qt6/lib/

Why This Solution Works

Anki 25.09 comes with Qt 6.9 libraries bundled, but the system tries to use Ubuntu’s Qt 6.4 libraries first. By setting LD_LIBRARY_PATH, we tell the system to prioritize Anki’s bundled libraries.


This solution allows Anki 25.09 to run on Ubuntu 24.04 LTS without system-wide changes.

1 Like

Weird I forgot I faced this issue before and it apparently only affects me and I keep coming up with the same solution. I’m on a completely new system now, not a VM, so I’m not sure what I’m doing to cause this as a recurring issue.

Notably the solution in that thread of simply installing libxcb-cursor0 doesn’t seem to work this time, it was already at latest version. Maybe refreshing with source .zshrc is necessary after install or something, idk, weird this bug follows me around like a tiny rain cloud.