Where (directory) to install Qt?

22,296

Solution 1

It should be available for all users, not me.

... answers your question. I would go for /opt/ purely so you separate it from your main system. Even though it might not 100% completely match the /opt/ definition it is the best place to put it.

Set it up with a group and add all the users needing it to that group.

/opt/

This directory is reserved for all the software and add-on packages that are not part of the default installation. For example, StarOffice, Kylix, Netscape Communicator and WordPerfect packages are normally found here. To comply with the FSSTND, all third party applications should be installed in this directory. Any package to be installed here must locate its static files (ie. extra fonts, clipart, database files) must locate its static files in a separate /opt/'package' or /opt/'provider' directory tree (similar to the way in which Windows will install new software to its own directory tree C:\Windows\Progam Files\"Program Name"), where 'package' is a name that describes the software package and 'provider' is the provider's LANANA registered name.

Solution 2

Qt is already installed on Ubuntu. If you want to develop Qt5 applications with QtCreator, then simply install the qtcreator package.

If you do need to install a newer version, then the installer from Qt likely installs based on how you run the installer. To install in /opt if that is what you wish to do, you will need to run the installer as root, such as by running sudo Qt5Installer.run (or whatever the command may be). If you run as your normal user, it will only allow you to install into a path where your user has write access, and generally this is somewhere under $HOME.

Another option is to use the Ubuntu SDK Release PPA, which has the ubuntu-sdk-ide package, which includes it's own private version of Qt (currently 5.4.1 as of this post, it seems). This should be following what the Ubuntu phone images ship, which will soon be upgraded to 5.5, and also soon to 5.6.

Unless you're actually depending on new APIs only available in the latest Qt release, then I'd recommend only building against the newest version of Qt which you absolutely need.

Share:
22,296

Related videos on Youtube

Horst Walter
Author by

Horst Walter

Updated on September 18, 2022

Comments

  • Horst Walter
    Horst Walter almost 2 years

    I am mainly a Windows user, but need to install Qt/QtC for testing purposes under Ubuntu 14.

    After downloading the installer (as described here: https://wiki.qt.io/Install_Qt_5_on_Ubuntu ) it wants to install under my home directory /home/myuser/Qt It works (I have tested it), but wonder if this is the correct place.

    Should it not be in /opt , or what is the best place to install it? It should be available for all users, not only me.

    --- Edit ---

    I need at least Qt 5.5 (soon Qt5.6) to be in sync with my Win environment. To me it looks like (dpkg -L libqt5core5a -> /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2 ) 5.2 is the default installation.

    --- Edit 2 ---

    Interesting, if I run sudo ./qt-unified-linux-x64-2.0.2-2-online.run the installer automatically proposes /opt/Qt as install dir.

  • Horst Walter
    Horst Walter over 8 years
    I have checked it under the "Software Center". There I find a "qtcreator 3.0.1-0ubuntu4", while the one I have installed is 3.6. So it seems to be outdated, or am I wrong here? I need Qt5.5 at least.