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?


  • Moderators

    @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:

    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....



  • @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


  • Moderators

    @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?


  • Moderators

    @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.


  • Moderators

    @rmam Well, a dead symlink isn't a QtCreator issue



  • @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.


  • Moderators

    @rmam You can ignore autodetected Qt versions - don't use them


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.