Ubuntu comes with limited support for Qt libraries by default. If you need a specific version for your applications you can have a hard time deploying it. One alternative is to static link them into your code, but then you loose the rights of (L)GPL. Because of that, I came up with a relatively simple solution: create a .deb file that you can deploy on your /usr/lib folder and use for any application.
To do it, just download the following deb package: qt_6.8.1_amd64.deb (make sure your browser`s blockers are disabled. Sometimes, it will say the download is insecure and block the download. If tit fails, check for that).
To install, use:
$ sudo dpkg -i qt-6.8.1_amd64.deb
The package will put all files into /usr/lib/qt-6.8.1, will add the ‘qt6’ library with version ‘6.8.1’ into the dependency system and will add a file into /etc/ld.so.conf.d/eikon-libs.conf pointing to /usr/lib/qt-6.8.1/lib. This library is nothing more than the regular Qt 6.8.1 binaries distributed by Qt Maintenance Tool, so it is the Open Source Community version that grants (L)GPL for use as linked library, which is exactly what this deb package provides.