Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to set a default Qt version in Linux?



  • Hello,

    I have Qt4 and Qt5 installed in my Ubuntu and, in Qt Creator I can easy manage which one will be used, but how to choose one of them to be the default in command line?
    The default in command line is Qt5, I want to change it to Qt4.

    Thanks!



  • Hello,

    I have uninstalled the package Qt5-default, with apt-get remove, and it automatically installed the Qt4-default package.
    Now in terminal, if I call qmake --version or qmake -query QT_VERSION, it shows me he is ysing Qt 4.

    So, I assume I can change the default Qt by installing the Qtx-defaul package, but have another way? Some way without internet or apt-get?

    Thanks!


  • Lifetime Qt Champion

    Hi,

    I don't know if it's provided, but have a look at the update-alternatives command


  • Moderators

    To develop on the command line: Just use the qmake that comes with the Qt package you want to use. I am no ubuntu expert, but usually that binary is in some -dev or -devel package.

    To switch Qt versions that are loaded when starting applications you might need to point the environment variable LD_LIBRARY_PATH to wherever the relevant .so files are located. This may or may not be necessary, depending on your system setup.


Log in to reply