Best way to install multiple versions of Qt with the regular installer in Debian/Ubuntu

Both Debian and Ubuntu distribute a single incomplete version of Qt through their official repositories. Thus, it's often necessary to resort to using Qt's regular installer to make available multiple versions of Qt and access recent and up-to-date versions of both Qt and related tools.

However, installing software from third-party sources, particularly from non-Deb packages, tends to cause some problems due to conflicts or missing configuration steps.

Therefore, does anyone know what's the best way (and better yet officially sanctioned way) to install Qt from Qt's regular installer in Debian and Ubuntu? For example, where should the files be installed? Which, if any, environment variables should be set? What additional steps and precautions should be taken to perform system-wide installations?

@rmam I never had any problems with Qt installed using Qt Online Installer. You can use this installer to install any supported Qt version. They will be installed in /home/USER_NAME/qt (or whatever directory you provide). So, why not simply use the Online Installer? And why do you think Qt provided by the distribution is incomplete? What is missing?

@rmam
One thing you need to bear in mind is that through apt-get (which is how I get everything Qt) you do need to specify which particular "optional" bits of Qt you want, in addition to the base package. As a random example:

If there are some overlapping files in the system then this may cause some problems. For example, after installing Qt from Qt's Online Installer Qt Creator failed to find the recently added Qt files, and instead apparently pointed to files and file locations where the official Ubuntu/Debian packages were/would be installed

@rmam I never had any issues with online installer. It installs Qt by default in /home/username/qt - so, there are no conflicts. You simply need to make sure your Kits in QtCreator are configured properly. If QtCreator cannot find the new installed Qt, then simply go to "Qt Versions" in QtCreator settings and add this Qt version there. Then create a Kit pointing to this Qt version.
But usually QtCreator detects Qt. My guess is you're still using QtCreator from your Linux distribution, use the one installed via Qt Online Installer.

If QtCreator cannot find the new installed Qt, then simply go to "Qt Versions" in QtCreator settings and add this Qt version there. Then create a Kit pointing to this Qt version.

After installing Qt with Qt's online installer, Qt Creator autodetected Ubuntu's default installation as well as the two Qt versions I've installed with Qt's online installer. Ubuntu's default install is listed with a yellow triangle with an exclamation mark. After uninstalling Ubuntu's qmake package, Qt Creator kept listing Ubuntu's default installation but this time displaying a red triangle with an exclamation mark.

Apparently Qt Creator doesn't let the user to remove autodetected entries, as both the "Remove" and "Clean up" buttons is greyed out.

Apparently Qt Creator searches for instances of qmake within the file system to autodetect Qt installations. However, that approach is error-prone. For example, Debian/Ubuntu come with a package called qtchooser, which supposedly provides an easy way to pick between default Qt versions by updating a bunch of symlinks, including symlink from /usr/bin/qmake. However, that symlink persists even when all Qt packages are removed. Therefore, Qt Creator keeps autodetecting a zombie Qt version in Debian/Ubuntu even when no Qt version is available, just because it found a dead symlink to a qmake instance.

Removing the qtchooser package is a bad idea because apparently it's listed as a dependency of a bunch of other packages.