What is the correct approach to install Qt SDK in Ubuntu?

  • I've just installed Ubuntu and started installing Qt 5.10 from the installer
    The Qt Creator works just fine but I couldn't make qmake to run from the terminal because I'm not acquainted with setting environment variables in Linux. I've searched and tried several methods but still qmake is not found. I've installed one version of Qt which is 5.10 but running qtchooser -list-versions yields this


    I didn't install Qt4 why it is there?

  • Lifetime Qt Champion

  • @mrjj yes I did. also, I came across this page when I was searching. Qt Creator is working fine but I couldn't manage to run qmake from the terminal. The environment variables are not set properly.

  • Qt Champions 2018


    If you install Qt with the Qt installer, no environment variables are changed. qtchooser is for the Qt versions contained in Ubuntus software repositories.

    So either call qmake with full path (e.g. /opt/Qt/5.9.2/gcc_64/bin/qmake for me) or add this path to your PATH environment variable (e.g. by adding this path in your ~/.bashrc:

    export PATH=$PATH:/path/to/your/qmake


  • @aha_1980 running export ... yields this error

    qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory

    It seems to me there is a default location that the shell searches in but I'm not able to modify it.

  • Do you have a special reason why you do not install QT from the Ubuntu repository?

    have you try sudo apt-get install qt5-qmake

  • Qt Champions 2018


    @aha_1980 running export ... yields this error

    That is because of:

    $ ll /usr/bin/qmake
    lrwxrwxrwx 1 root root 9 Dez  9  2015 /usr/bin/qmake -> qtchooser*

    So either call qmake with the full path or (hacky) delete /usr/bin/qmake.

  • @aha_1980 so is it Ok to copy qmake 5.10 inside that folder? I don't want to delete it since some system's files may use Qt4. I don't want to mess with it.

  • Lifetime Qt Champion


    No, use the full path to the version of qmake you want to use.

  • @SGaist so adding environment variable is not an option here, Right?

  • @ckvsoft good question. Actually, I though the version in the repository is not the latest that is why I'v chosen the suggested tool in Qt download page. Not to mention that in Qt website, there is no mention to download the library from the repository. I maybe wrong regarding whether the repository doesn't include the latest version.

  • Lifetime Qt Champion

    It could be but you'd have to keep it up to date with each new release of Qt.

    Unless you plan to develop with only one version of Qt, I'd recommend sticking with the use of the full path. That way you know for sure the version you are currently calling.

    An alternative if you really want to avoid the full path is to use a symbolic link and call it something like qmake-5.10.

Log in to reply

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