Important: Please read the Qt Code of Conduct -

Using update-alternatives when deploying two versions of Qt on OpenSuse Linux

  • I have version of Qt installed from repositories of OpenSuse Linux. But it lacks some of the Qt components and I needed to install SDK.
    When you install two versions of Qt on Linux you need to tell the system which compiler to use.
    I used the following command to add newer qmake as alternative to preinstalled qmake: "sudo update-alternatives --install /usr/bin/qmake qmake /opt/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake 10"
    Command output:
    "Update-alternatives: warning: /etc/alternatives/qmake has been changed (manually or by a script). Switching to manual updates only.
    Update-alternatives: using /opt/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake to provide /usr/bin/qmake (qmake) in auto mode.
    update-alternatives: warning: not replacing /usr/bin/qmake with a link"

    Problem is when I execute qmake still old version is used.

    Then I ran command "sudo update-alternatives --display qmake"
    Output: "qmake - auto mode
    Link currently points to /opt/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake
    /opt/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake - priority 10
    Current 'best' version is '/opt/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake' "

    I also get strange output from command: "sudo update-alternatives --config qmake"

    "There is only one alternative in link group qmake: /opt/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake
    Nothing to configure.
    update-alternatives: warning: forcing reinstallation of alternative /opt/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake because link group qmake is broken.
    update-alternatives: warning: not replacing /usr/bin/qmake with a link"

    That's the point where I got stuck would like to ask for a help if somebody knows the question.

  • Lifetime Qt Champion

    Is all that really needed? Why not just call the right qmake?
    And in QtCreator you can define two Kits one for each Qt version.

  • @jsulm good idea, thanks!

Log in to reply