Help needed installing anki on xubuntu [linux]

Hiya all,
I’m on Xubuntu linux, trying to install [Qt6] Anki following the official instructions. Installs fine. When I go to launch it (from terminal), I get this:

anki
Anki starting…
Initial setup…
Preparing to run…
File “”, line 1, in
File “aqt”, line 509, in run
File “aqt”, line 583, in _run
File “aqt.profiles”, line 139, in setupMeta
File “aqt.profiles”, line 421, in _loadMeta
resetting corrupt _global
Qt warning: QGuiApplication::setDesktopFileName: the specified desktop file name ends with .desktop. For compatibility reasons, the .desktop suffix will be removed. Please specify a desktop file name without .desktop suffix
Qt warning: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
Qt info: Could not load the Qt platform plugin “xcb” in “” even though it was found.
Qt fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: offscreen, wayland, wayland-egl, vkkhrdisplay, minimalegl, linuxfb, vnc, eglfs, minimal, xcb.

What should I do?
Oh, and yes, I did do:

sudo apt install libxcb-xinerama0 libxcb-cursor0 libnss3

Any help much appreciated.

This is the important part.

I’m guessing that you’re using xfce because you’re on Xubuntu. I searched for xfce and found a user with the same error as above, but on Debian: Anki 23.12.1 fail to start in Debian 12

Dae linked to this page: Missing Libraries - Anki Manual. It says to launch with QT_DEBUG_PLUGINS=1 anki to add debug output in order to see which library is missing.

In that user’s case, dae saw that libxcb-icccm.so.4 was missing via the end of the last line starting with Qt debug:

and a search for the required package gave libxcb-icccm4:

I’d still try to follow those steps instead of going straight to installing the package. Try to find a similar error message using QT_DEBUG_PLUGINS=1 anki and then find out what package provides/owns the missing library.

In case the apt search command shown above doesn’t work for you, I did a few searches. On my OS, the search I’d use is pacman -Qo <missing-library> pacman -F <missing-library> to find which package owns it. This page gives the equivalent in Debian/Ubuntu: pacman/Rosetta - ArchWiki

pacman -Qo equivalents likely incorrect in this case, see edit below
dpkg -S <missing-library>

OR

dlocate <missing-library>

Edit: I tested. libxcb-icccm.so.4 showed up by using pacman -F, not pacman -Qo. So the command in that case would be:

apt-file search <missing-library>

Man pages:
dpkg
dlocate
apt-file

3 Likes

Thanks for the reply.
So, I ran QT_DEBUG_PLUGINS=1 anki and got this:

Qt debug: Got keys from plugin meta data QList(“xcb”)
Qt debug: checking directory path “/usr/local/share/anki/platforms” …
Qt debug: “/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so” cannot load: Cannot load library /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)
Qt debug: QLibraryPrivate::loadPlugin failed on “/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so” : “Cannot load library /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)”
Qt warning: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
Qt info: Could not load the Qt platform plugin “xcb” in “” even though it was found.
Qt fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

I’ve tried searching for libxkbcommon-x11.so.0 without luck, though I don’t really know what I’m doing.
What should I do next?

The Xubuntu releases page has two versions listed, Mantic (23.10) and Jammy (22.04). But I think what version you have doesn’t matter in this case.

Using Ubuntu’s package search, I found libxkbcommon-x11.so.0 in the libxkbcommon-x11-0 package for both.

This command should install it for you:
sudo apt install libxkbcommon-x11-0

And hopefully Anki should start after that.

2 Likes

Hi again,
Thanks, I installed libxkbcommon-x11-0, but anki still won’t run.
Here’s the output from QT_DEBUG_PLUGINS=1 anki now:

Qt debug: Got keys from plugin meta data QList(“xcb”)
Qt debug: checking directory path “/usr/local/share/anki/platforms” …
Qt debug: “/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so” cannot load: Cannot load library /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)
Qt debug: QLibraryPrivate::loadPlugin failed on “/usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so” : “Cannot load library /usr/local/share/anki/lib/PyQt6/Qt6/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)”
Qt warning: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
Qt info: Could not load the Qt platform plugin “xcb” in “” even though it was found.
Qt fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

I’m afraid I need to ask for more help. I’ve tried searching that ubuntu packages list, without much success.
Oh, and I’m on Xubuntu 22.04.

It’s the second search field available since we’re searching for package contents. I should’ve made that more clear. Here’s a picture of my search on that search page:

I selected Jammy since you’re on 22.04. Results page: Ubuntu – Package Contents Search Results -- libxcb-icccm.so.4

The next package to install is libxcb-icccm4.

2 Likes

Ok, I installed libxcb-icccm4, still problems launching. Then I repeated QT_DEBUG_PLUGINS=1 anki, and successfully searched for libxcb-keysyms.so.1, found and installed libxcb-keysyms1.
Success! Anki is now launching and running fine, I’ve downloaded all my cards and can verify that everything is working as it should.

Arigato @stupid, you’ve been extremely helpful and prompt. Couldn’t have done it without your help.

1 Like

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