Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
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
qmaketo run from the terminal because I'm not acquainted with setting environment variables in Linux. I've searched and tried several methods but still
qmakeis not found. I've installed one version of Qt which is 5.10 but running
qtchooser -list-versionsyields this
4 5 default qt4-x86_64-linux-gnu qt4 qt5-x86_64-linux-gnu qt5
I didn't install Qt4 why it is there?
did you install compiler and tools?
@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.
If you install Qt with the Qt installer, no environment variables are changed.
qtchooseris 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/qmakefor me) or add this path to your
PATHenvironment variable (e.g. by adding this path in your
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.
ckvsoft last edited by ckvsoft
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
@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
@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.
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.
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.