4

I have installed Qt 5.6 from the official website via a *.run file. The installation directory is in my home folder. When I run

qmake --version

I get the following message:

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

I think the problem is that the operating system does not look for the qmake in the correct directory (I have Qt installed in my home folder).

How can I tell the operating system to search for Qt in my home folder?

Unique
  • 175
  • 3
  • 5
  • 13

2 Answers2

10

The solution lies in using update-alternatives(8). For more information on the reasoning behind it, refer to What exactly does `update-alternatives` do?

sudo update-alternatives --install /usr/bin/qmake qmake /usr/lib/x86_64-linux-gnu/qt5/bin/qmake 100

followed by:

sudo update-alternatives --config qmake

to make sure the qt5 version is being used. This will update /usr/bin/qmake to point to the qt5 version.

A side note: You may need to check /usr/bin/ to see if there is already a symlink. If it is not managed by update-alternatives then you may need to manually remove or rename it for this to work.

Hope that helps!

0

This worked for me:

sudo apt-get install qt4-qmake libqt4-dev

Followed by:

sudo update-alternatives --install /usr/bin/qmake qmake /usr/lib/x86_64-linux-gnu/qt4/bin/qmake 100