22

I have installed Qt5 from the Qt5 project site, to the following directory

/opt/Qt5 

I would also like to mention that I had Qt4 installed previously, I have removed all instances of Qt4 through the software center.

Now that I issue designer from the command prompt, the system gives the following error:

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

What can be done to correct this problem?

Avinash Raj
  • 77,204
  • 56
  • 214
  • 254
Indian
  • 1,560
  • 5
  • 22
  • 39

4 Answers4

37

Replace Default Qt version paths in:

/usr/lib/x86_64-linux-gnu/qtchooser/default.conf
or in newer releases /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf:

/opt/Qt5/bin
/opt/Qt5/lib

Check:

qtchooser -print-env

Reference: man qtchooser

user.dz
  • 47,137
  • 13
  • 140
  • 258
  • 4
    Actually the file `/usr/lib/x86_64-linux-gnu/qtchooser/default.conf` is a symlink to the one in `/usr/share/qtchooser/default.conf` – Anwar Jun 10 '17 at 05:55
2

For all of those who didn't uninstal old version and are wondering how to change the qt directory location. The correct way is to export the QT_SELECT variable and add the custom ~/.config/qtchooser/somename.conf file.

This will be a qt installation visible in qtchooser -l under "somename". So that:

 QT_SELECT=somename; qtchooser -print-env 

Will return your custom location. The downside of changing the default.conf is that it might invalidate where your old qt version is found, when I did change it to /some/path, after executing:

QT_SELECT=qt4; qtchooser -print-env

It find the newer version on my path, however with the ~/config/qtchooser/somename.conf the earlier version is intact.

It is mentioned at the end of the man qtchooser help:

FILES /etc/xdg/qtchooser/*.conf System-wide configuration files. Each has two lines, the first is the path to the binaries and the second is the path to the Qt libraries. If a default.conf is provided, the settings from it will be automatically used in case nothing else is selected.

$HOME/.config/qtchooser/*.conf configuration files

cerkiewny
  • 123
  • 3
2

Proper path to qt default config: /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf

muru
  • 193,181
  • 53
  • 473
  • 722
  • 2
    You may want to suggest this as an edit to the other answer. The answer section should be reserved for entire answers. – David Foerster Mar 21 '15 at 01:42
  • Yes qtchooser will look at the default.conf, you can create a symlink `ln -s /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf /usr/lib/x86_64-linux-gnu/qtchooser/default.conf` – Melroy van den Berg Aug 04 '17 at 22:15
0

I tried the answers suggesting to check the configuration in the qtchooser, but I didn't manage to get it to work. The solution that worked for me was simply to add the right qt version to PATH. 5.11 in my case.

export PATH="/opt/qt511/bin:$PATH"
SydB
  • 1
  • 1