When trying to open a program that requires Qt6, it gives error while loading shared libraries: libQt6Network.so.6: cannot open shared object file: No such file or directory. I tried installing Qt6 by going to the Qt website -> Downloads for open source users -> Download the Qt Online Installer -> Qt Online Installer for Linux (64-bit), then in the installer itself I selected "Qt 6.2 for desktop development". After it'd finished installing I restarted and tried to open the program again, and it still gave the same error. I'd also seen sudo apt install qt6-base-dev be suggested so I tried that, but that just gives the error Unable to locate package qt6-base-dev, so now I'm not sure what else I could try.
Asked
Active
Viewed 9.3k times
20
Foxes
- 303
2 Answers
23
libqt6network6 is indeed part of the qt6-base-dev meta-package and you can install it like so:
sudo apt install qt6-base-dev
However, unfortunately, this meta-package is not available for Ubuntu 21.10. It is currently available only for Ubuntu 22.04
Raffa
- 35,113
-
@Foxes Either you upgrade to Ubuntu 22.04 which I strongly recommend ... or you go the "at your own risk way" :) – Raffa Apr 24 '22 at 22:14
-
Not really a risk, qt6 works just fine even on 20.04, just go get them from Qt center, I currently develop under 20.04 and have no issues even with qt 6.9.1, and 20->22 breaks nvidia legacy drivers, so better check that before hand before ever upgrading. IMO the only reason anyone should upgrade is to take advantage of pipewire or new video drivers, but if you have older hardware don't do it. (fyi, you can easily acquire qt drivers via the qt installation tool - just be sure to export LD_LIBRARY_PATH and the QT_ variables if you put them somewhere custom) – osirisgothra Jun 12 '25 at 03:48
5
You might try to use Owen Kirby's backport of Qt6:
sudo add-apt-repository ppa:okirby/qt6-backports
sudo apt update
sudo apt install qt6-base-dev [...]
Just like @Raffa, I also strongly recommend the update to Ubuntu 22.04, and Owen Kirby's backports are perhaps not the most up to date (6.2.2 at the time of writing; it's a LTS version; the most recent version of Qt 6 is 6.3.1), but it should get you going
Gwyneth Llewelyn
- 191
-
1Ubuntu 22 (or more specifically, the kernel) does not support legacy NVIDIA drivers, be aware of that before upgrading. If you are unsure, boot into a live "Try Ubuntu" and run "nvidia-detector" from a terminal first, if it prints out 'none' and 'none' then it wont support it, if it shows the same thing as the "lspci" command does (your card name) then you are OK to upgrade it assuming no other legacy drivers are needed -- this pertains only to proprietary drivers which are few, but when they are needed it usually is crucial that you have them. – osirisgothra Jun 12 '25 at 03:53
-
@osirisgothra I had no idea about that! I should keep that in mind when I turn my MacBook Pro from 2014 (unsupported for years by Apple) into a Linux box — I have had excellent experiences with that with an even older Mac (using an Ubuntu derivative). One reason for keeping this Mac running is that it's the last model ever from Apple that includes an NVIDIA card — which I happen to love. Perhaps I'll have some issues when trying to run Ubuntu on it... I'll need to use that "Try Ubuntu" USB stick to do some testing first! – Gwyneth Llewelyn Jun 28 '25 at 16:47