How can I correctly install qt5?

23,092

Normally they exist simultaneously.

List available versions:

$ qtchooser -l
4
5
default
qt4-i386-linux-gnu
qt4-x86_64-linux-gnu
qt4
qt5-x86_64-linux-gnu
qt5.5-x86_64-linux-gnu
qt5

Find out where it is:

$ qtchooser -qt=4 -print-env
QT_SELECT="4"
QTTOOLDIR="/usr/lib/x86_64-linux-gnu/qt4/bin"
QTLIBDIR="/usr/lib/x86_64-linux-gnu"

Use it with qmake:

$ qmake -qt=5 --version
QMake version 3.0
Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

For CMake set CMAKE_PREFIX_PATH to things like /usr/lib/x86_64-linux-gnu/qt5/lib/cmake/ (for Qt installs from the package manager) or /data/qt/Qt-5.5/5.5/gcc_64/lib/cmake/ (that kind of structure comes from the manual installs).

Share:
23,092

Related videos on Youtube

daveomcd
Author by

daveomcd

Updated on September 18, 2022

Comments

  • daveomcd
    daveomcd over 1 year

    I'm trying to upgrade from qt4 to qt5. I was following a guide and it appears I have managed to install qt5. As seen here...

    daveomcd@ubuntu:~/Documents/rails_projects/bane$ dpkg -l qt5-qmake
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name                                          Version                     Architecture                Description
    +++-=============================================-===========================-===========================-================================================================================================
    ii  qt5-qmake:amd64                               5.5.1+dfsg-16ubuntu7.1      amd64                       Qt 5 qmake Makefile generator tool
    

    The guide mentioned doing rm 'which qmake' to remove the old install of qt4 at some point. But know the software I'm trying to use that relies on qmake is no longer working. I get the following error: Command 'qmake ' not available

    Anyone know how I can resolve this issue? Also it seems qt4 is still installed as well. As seen below.

    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name                                          Version                     Architecture                Description
    +++-=============================================-===========================-===========================-================================================================================================
    ii  qt4-qmake                                     4:4.8.7+dfsg-5ubuntu2       amd64                       Qt 4 qmake Makefile generator tool
    

    Update: When I do... qtchooser -l I get the following:

    4
    5
    default
    qt4-x86_64-linux-gnu
    qt4
    qt5-x86_64-linux-gnu
    qt5
    
  • daveomcd
    daveomcd over 7 years
    when I try the qmake command I get The program 'qmake' is currently not installed. You can install it by typing: sudo apt install qtchooser. Though it appears qtchooser is already installed.
  • daveomcd
    daveomcd over 7 years
    So I did sudo apt-get install --reinstall qtchooser and that corrected it. I'm trying the software now... thanks!