Installation of Qt 6 on ubuntu 20.04
-
Hi all,
Since official support for Qt 5.15 is going to end soon, I am upgrading Qt to version 6 on Ubuntu 20.04.
My environment is Deepstream 6.3 on Nvidia docker container on Ubuntu 20.04
Is it possible to install Qt 6 on ubuntu 20.04?
Because from https://doc.qt.io/qt-6.5/linux.html supported platform is Ubuntu 22.04
Since I have dependency with Ubuntu 20.04, I can't upgrade it to 22.04
Anyone please help me on this. -
Why do you want to update Qt then at all?
-
@Christian-Ehrlicher Thank you so much for your information.
Until we decide to upgrade to Ubuntu 22.04, I need to stick with Ubuntu 20.04
Is there anyway I can install Qt version 6 on Ubuntu 20.04?
In the page https://doc.qt.io/qt-6.5/linux.html supported platform for Qt version 6 is Ubuntu 22.04 -
@ShahShaj I think what @Christian-Ehrlicher tried to say is: you want to go from Qt5 to Qt6 because the support for Qt5 ends, but you use an Ubuntu version with support also ending soon. An unsupported operating system is a way bigger issue than an unsupported framework version (security fixes and such). So, you could simply continue to use Qt5 until you upgrade to a newer and supported Ubuntu version.
-
@jsulm Correct 🙂
-
@ShahShaj You CAN run Qt 6.5 and above on Ubuntu 20.04, but not with the pre-compiled packages provided by the project. There are ABI mismatches regarding glibc, OpenSSL and libwayland (and possibly more) that lead to crashes or worse. You'll need to build Qt from source code yourself.
That said, I concur that it is a strange thing to do - an EOL base image is much worse from an IT security standpoint that an EOL graphics toolkit.
-
Plus, your hardware might be too old for Qt 6.5 as well. For example, its multimedia module may require higher versions of gstreamer or FFmpeg which will not work with your hardware possibly. The drivers of newer versions of gstreamer or FFmpeg may not be compatible with the video card in your computer.
-
Hi @ShahShaj,
While I completely agree with everything the others have said, just for fun (and to answer the original topic question) I've tried installing Qt on Ubuntu 20.04 on GitHub Actions, via
install-qt-action
, which in turn usesaqtinstall
- a Python-based application that installs Qt from the same public mirrors as the Qt Online Installer.For my project, the result is
aqtinstall
successfully installs Qt 6.2 through to 6.9 on (GitHub-modified) Ubuntu 20.04.06 LTS. Note, that "GitHub modified" bit might be important - I'm not sure how much customisation GitHub does to their Ubuntu images, but you can see their customisations for yourself at https://github.com/actions/runner-images(Also note, I didn't try installing Qt 6.0 or 6.1, just because I did this on a temporary branch of a project that uses Bluetooth, and Qt didn't add BLE support to the Qt 6 branch until 6.2)
Now, once installed, the open source project I tried this on, managed to build and pass all unit tests quite happily using gcc, but not using clang. However, it appears that the clang failures might be because of some very-modern code coverage support my project enables, so clang might work just fine if I disabled coverage reporting, but doing so was a step too far for me to both with this experiment :D
So, my hypothesis is that:
- installing Qt 6.x on Ubuntu 20.04 should be possible via
aqtinstall
. - possibly requiring some prerequisites first though (such as some system libraries, Python, etc being installed and/or upgraded)
- possibly only for gcc (clang may or may not work; didn't work initially for me)
You can see which builds passed (ie the gcc ones) and which failed (ie the clang ones) here: https://github.com/pcolby/dokit/actions/runs/14154258108
You can see the modified GitHub workflow file I used here: https://github.com/pcolby/dokit/actions/runs/14154258108/workflow
You can see the
aqtinstall
commands that did the actual Qt installation by looking at the log output of the "Install online Qt version" steps, for example:python3 -m aqt install-qt linux desktop 6.9.0 --autodesktop --outputdir /home/runner/work/dokit/Qt --modules qtconnectivity
Finally, let me reiterate what others have said: absolutely try to upgrade your OS if you can (I know nothing about nVidia's Deepstream). But if you can't, then give
aqtinstall
a go. I'm sure it won't be easy, but should be possible...Good luck :)
- installing Qt 6.x on Ubuntu 20.04 should be possible via