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?
-
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?
-
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
One thing you need to bear in mind is that throughapt-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:sudo apt install libqt5charts5 libqt5charts5-dev
is required if you need the optional Qt Charts package.
And it is possible that individual distros occasionally have a glitch with what is available, e.g. apparently as per https://github.com/marazmista/radeon-profile/issues/66 the above works with Ubuntu 17.10 but was missing from Ubuntu 17.04....
-
@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?
@jsulm said in Best way to install multiple versions of Qt with the regular installer in Debian/Ubuntu:
So, why not simply use the Online Installer?
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
-
@jsulm said in Best way to install multiple versions of Qt with the regular installer in Debian/Ubuntu:
So, why not simply use the Online Installer?
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. -
@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.@jsulm said in Best way to install multiple versions of Qt with the regular installer in Debian/Ubuntu:
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.
Is there any way to ignore an autodetected entry?
-
@jsulm said in Best way to install multiple versions of Qt with the regular installer in Debian/Ubuntu:
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.
Is there any way to ignore an autodetected entry?
@rmam said in Best way to install multiple versions of Qt with the regular installer in Debian/Ubuntu:
Is there any way to ignore an autodetected entry?
Yes - don't use it.
Don't use the Kit which uses this autodetected Qt.
Also, if you put mouse cursor over this yellow/red exclamation mark - what do you see? -
@rmam said in Best way to install multiple versions of Qt with the regular installer in Debian/Ubuntu:
Is there any way to ignore an autodetected entry?
Yes - don't use it.
Don't use the Kit which uses this autodetected Qt.
Also, if you put mouse cursor over this yellow/red exclamation mark - what do you see?@jsulm said in Best way to install multiple versions of Qt with the regular installer in Debian/Ubuntu:
Yes - don't use it.
Don't use the Kit which uses this autodetected Qt.Ok good to hear.
Also, if you put mouse cursor over this yellow/red exclamation mark - what do you see?
Unfortunately, nothing.
-
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.
-
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.
-
@jsulm yes it obviously is if Qt Creator interprets a dead symlink as the presence of a full Qt installation.
This problem is further compounded by the fact that Qt Creator offers no way to ignore/blacklist autodetected instances of Qt.
-
I confirm that the problem identified in this thread still exist.
On Ubuntu, using the online installer, I have installed several version of Qt - 5.15.2 and 6.1.2, in addition to the "default" one 5.12.8 installed from a repository.
In Qt Creator (I have tried two versions: QtCreator 4.15.2 and 5.0.0-beta1), while 6.1.2 seems to be able to start properly (could not do a complete check on my code since some of the modules are still missing in Qt6),
the 5.15.2 version is bugging:
If I select this version in QtCreator, and compile my code, I get this error (multiple times):
/home/andr/Qt/5.15.2/gcc_64/bin/uic: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found (required by /home/andr/Qt/5.15.2/gcc_64/bin/uic)Is there a configuration step I am missing?