The xcb QPA platform plugin lacks a `.deb` package similar to `build-essential`

sudo apt update

sudo apt install -y libxkbcommon-dev libxkbcommon-x11-dev

sudo apt-get install libxcb-icccm4 libfontconfig1 libxcb-glx0 libx11-xcb1 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 libgl1

sudo apt install make g++ pkg-config libgl1-mesa-dev libxcb*-dev libfontconfig1-dev libxkbcommon-x11-dev libgtk-3-dev

Welcome. This is a lot of information for what appears to be the simple question “A graphical QT-based application I built in WSL doesn’t launch”, which I think is a fair one-line summary of the text.

This screenshot from your first link is a clue:

Go back to basics. Does any Xorg application launch in that WSL instance?

e.g. if you follow this guide, can you run (for example) xclock, or xeyes?

If so, then we can look deeper. Is the DISPLAY environment variable set?

echo $DISPLAY

(All of this is of course ignoring why on earth someone wants to run the Linux version of Calibre on Windows, when there’s a Windows native version, but that’s your choice :slight_smile: )

  • @popey Late reply, because my Outlook mailbox marked the forum reply as spam…

First

sudo apt update && sudo apt upgrade -y
sudo apt install gnome-text-editor gimp vlc nautilus x11-apps -y
cd /tmp
sudo apt install libopengl0 libxcb-cursor0 -y
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
calibre
  • x11-apps is indeed not a default installation option for Ubuntu WSL. Microsoft’s documentation explains this as well.

Second

  • But then again, if a person doesn’t know Qt at all, he is likely to do something like this. I don’t actually know much about Qt either…
sudo apt update && sudo apt upgrade -y
cd /tmp
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
  • Then he will get an error similar to this:
Using python executable: /usr/bin/python3
2024-12-15 16:48:32 URL:https://download.calibre-ebook.com/linux-installer.sh [35050/35050] -> "-" [1]
You are missing the system library libOpenGL.so.0. Try installing packages such as libopengl0
sudo apt update && sudo apt upgrade -y

cd /tmp

sudo apt install libegl1 libopengl0 libxcb-cursor0 libfontconfig1 libxkbcommon0 libglx0 libnss3 libxcomposite1 libxdamage1 libxrandr2 libxtst6 libxkbfile1 libxcb-xinerama0 -y

sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
  • Then the user will find Qt’s error message, which is not intuitive.
Using python executable: /usr/bin/python3
2024-12-15 16:52:12 URL:https://download.calibre-ebook.com/linux-installer.sh [35050/35050] -> "-" [1]
Installing to /opt/calibre
Downloading tarball signature securely...
Will download and install calibre-7.22.0-x86_64.txz
                                      Downloading calibre-7.22.0-x86_64.txz
100% [========================================================================================================]

Downloaded 183175740 bytes
Checking downloaded file integrity...
Extracting files to /opt/calibre ...
Extracting application files...
Creating symlinks...
        Symlinking /opt/calibre/ebook-device to /usr/bin/ebook-device
        Symlinking /opt/calibre/ebook-meta to /usr/bin/ebook-meta
        Symlinking /opt/calibre/ebook-convert to /usr/bin/ebook-convert
        Symlinking /opt/calibre/ebook-polish to /usr/bin/ebook-polish
        Symlinking /opt/calibre/markdown-calibre to /usr/bin/markdown-calibre
        Symlinking /opt/calibre/web2disk to /usr/bin/web2disk
        Symlinking /opt/calibre/calibre-server to /usr/bin/calibre-server
        Symlinking /opt/calibre/lrf2lrs to /usr/bin/lrf2lrs
        Symlinking /opt/calibre/lrs2lrf to /usr/bin/lrs2lrf
        Symlinking /opt/calibre/calibre-debug to /usr/bin/calibre-debug
        Symlinking /opt/calibre/calibredb to /usr/bin/calibredb
        Symlinking /opt/calibre/calibre-parallel to /usr/bin/calibre-parallel
        Symlinking /opt/calibre/calibre-customize to /usr/bin/calibre-customize
        Symlinking /opt/calibre/fetch-ebook-metadata to /usr/bin/fetch-ebook-metadata
        Symlinking /opt/calibre/calibre-smtp to /usr/bin/calibre-smtp
        Symlinking /opt/calibre/calibre to /usr/bin/calibre
        Symlinking /opt/calibre/lrfviewer to /usr/bin/lrfviewer
        Symlinking /opt/calibre/ebook-viewer to /usr/bin/ebook-viewer
        Symlinking /opt/calibre/ebook-edit to /usr/bin/ebook-edit
Setting up command-line completion...
Installing zsh completion to: /usr/share/zsh/vendor-completions/_calibre
Failed to find directory to install bash completions, using default.
Installing bash completion to: /usr/share/bash-completion/completions/
Failed to import PyQt module: PyQt6.QtWebEngineCore with error: libasound.so.2: cannot open shared object file: No such file or directory

____________________ WARNING ____________________
Setting up completion failed with error:
__________________________________________________


        Traceback (most recent call last):
          File "calibre/linux.py", line 838, in setup_completion
          File "calibre/linux.py", line 588, in write_completion
          File "bypy-importer.py", line 279, in exec_module
          File "calibre/gui2/tweak_book/main.py", line 12, in <module>
          File "bypy-importer.py", line 279, in exec_module
          File "calibre/ebooks/oeb/polish/check/css.py", line 12, in <module>
        ImportError: cannot import name 'QWebEnginePage' from 'qt.webengine' (/opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/qt/webengine.pyc)

Setting up desktop integration...

____________________ WARNING ____________________
Setting up desktop integration failed with error:
__________________________________________________


        Traceback (most recent call last):
          File "calibre/linux.py", line 859, in setup_desktop_integration
          File "calibre/linux.py", line 881, in do_setup_desktop_integration
          File "calibre/linux.py", line 912, in install_xdg_junk
          File "calibre/linux.py", line 897, in install_icons
          File "calibre/linux.py", line 891, in install_single_icon
          File "subprocess.py", line 408, in check_call
          File "subprocess.py", line 389, in call
          File "subprocess.py", line 1026, in __init__
          File "subprocess.py", line 1950, in _execute_child
        FileNotFoundError: [Errno 2] No such file or directory: 'xdg-icon-resource'

Creating un-installer: /usr/bin/calibre-uninstall


There were 2 warnings

* Setting up completion failed with error:

* Setting up desktop integration failed with error:

Run "calibre" to start calibre
Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" in "" even though it was found.
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: minimalegl, vkkhrdisplay, vnc, wayland, wayland-egl, offscreen, minimal, linuxfb, eglfs, xcb.

Aborted (core dumped)
  • This is the origin of the title of this issue – “The xcb QPA platform plugin lacks a .deb package similar to build-essential”.

If so, then we can look deeper. Is the DISPLAY environment variable set? echo $DISPLAY

  • At this point, x11-apps is not installed yet, so the result of executing echo $DISPLAY is :0.

Third

  • The opinion of the calibre maintainers at Bug #2073474 “Installing Calibre under WSL lacks prompts for dep...” : Bugs : calibre is that Qt, as a common public dependency, should exist as an integrated .deb package in the default apt-get repository for distributions including Ubuntu.
  • In summary, this is also the origin of this issue. I personally expect that there is a .deb package in the apt-get library that can install all Qt-related dependencies at one time.

I think we disagree here. The problem is not that there is a package missing in the repository. The problem is that whoever documented how to build the software you’re building, didn’t test in the way you’re testing, so didn’t document whatever specific developer tools you need.

In essence, all someone needs to do is build what you’re building, and write down the necessary packages, just like we do for any other software that’s built from source.

Can we please take a step back from offering a solution, to asking a question?

e.g. “I can’t build and run DingTalk on Ubuntu under WSL?” and then list what commands you tried, and what didn’t work. That will lead us to a solution.

2 Likes
  • @popey I agree that this issue could be reduced to a simple question and then updated on the qt wiki, as is the potential solution at https://bugreports.qt.io/plugins/servlet/mobile#issue/QTBUG-126021 .
  • The only problem is that I personally don’t know the apt package names for the .so files that qt 6 needs, so updating the wiki is unlikely to be done by me. The qt6 documentation implicitly points out that this problem is not unique to wsl, but it is most obvious on wsl due to the lack of a standard desktop environment.
  • Should I mark the current discussion thread as resolved? I think I might be better off opening a new discussion to avoid going off topic. The problem for Calibre is that Qt6 lacks documentation on Ubuntu WSL. The problem for DingTalk is that DingTalk requires a complete Qt6 environment and some additional dependencies, but I don’t know which apt packages are needed for the complete Qt6 environment.

This is as simple as:

$ sudo apt install apt-file
$ sudo apt-file update
$ apt-file search libfoobar.1.2.3.so
[...]
libfoobar123: /usr/lib/....
$

(for development you then need to look up the -dev package names of the found packages)

2 Likes

I don’t think so, yet, as we haven’t identified the steps needed to build and run the package you’re interested in.

I’ll try and reproduce this on a windows machine, when I get a moment.

2 Likes