17

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?

  • 1
    Qt5 is packaged and available in the archives for Ubuntu 13.10. Why didn't you install it from there? – dobey Mar 17 '14 at 18:41
  • 2
    And if you need the latest Qt 5.2.1, it's now available in the 14.04 development version – Sylvain Pineau Mar 17 '14 at 20:12
28

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

|improve this answer|||||
  • 3
    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 5:55
2

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

|improve this answer|||||
  • 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 1: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 – danger89 Aug 4 '17 at 22:15
1

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

|improve this answer|||||
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"
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.