68

Need to build simple GUI application. For this reason I decided to install Qt on my Ubuntu 16. I have downloaded open source Qt edition from theirs site. Got error while run:

g@ubuntu:~/Downloads$ ./qt-unified-linux-x86-2.0.5-2-online.run 
./qt-unified-linux-x86-2.0.5-2-online.run: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

How to fix that?

4
  • Why not just install it from the repo, using apt-get?
    – code_dredd
    Jan 8, 2018 at 9:31
  • 1
    sudo apt-get install qt brings E: Unable to locate package qt
    – vico
    Jan 8, 2018 at 9:35
  • Are you running that under graphical desktop?
    – hyde
    Jan 8, 2018 at 9:45
  • 4
    Try apt-cache search qt first and then pick the according packages. Jan 8, 2018 at 9:46

5 Answers 5

130

Install Qt

sudo apt-get install build-essential

sudo apt-get install qtcreator

sudo apt-get install qt5-default

Install documentation and examples If Qt Creator is installed thanks to the Ubuntu Sofware Center or thanks to the synaptic package manager, documentation for Qt Creator is not installed. Hitting the F1 key will show you the following message : "No documentation available". This can easily be solved by installing the Qt documentation:

sudo apt-get install qt5-doc

sudo apt-get install qt5-doc-html qtbase5-doc-html

sudo apt-get install qtbase5-examples

Restart Qt Creator to make the documentation available.

Error while loading shared libraries

Problem:

radiusd: error while loading shared libraries: libfreeradius-radius-2.1.10.so: cannot open shared object file: No such file or directory

Reason:

Actually, the libraries have been installed in a place where dynamic linker cannot find it.

Solution:

While this is not a guarantee but using the following command may help you solve the “cannot open shared object file” error:

sudo /sbin/ldconfig -v

http://www.lucidarme.me/how-install-documentation-for-qt-creator/

https://ubuntuforums.org/showthread.php?t=2199929

https://itsfoss.com/error-while-loading-shared-libraries/

ModelSim-Altera error

5
  • 4
    (Ubuntu 20.04): installing qtcreator before qt5-default (qt5-qmake) prevented qtcreator from automatically detecting qmake. This had to be manually added via; 1) qtcreator - tools - options - Qt Versions - Manual - Add - qmake location: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake, 2) qtcreator - tools - options - Manual - Desktop (default) - Qt version - Qt 5.xx Sep 17, 2020 at 12:24
  • The comment above was spot on! I accidentally installed qtcreator before qt5 and had issues, e.g. the creator wasn't showing the examples (Ubuntu 20.04). Following the steps fixed it.
    – fr_andres
    May 9, 2021 at 18:29
  • Now that Qt 6 is out, it seems best to install "qt5-default" first, then "qtcreator", correct ? (supposing you want Qt 5)
    – cdahms
    Oct 31, 2021 at 18:38
  • user2585501 give solution for my case. Sep 19, 2022 at 9:34
  • UPDATE: qt5-default no longer exists. If anyone has a workaround, please tell. Need to install the libs for runtime only, not dev work. Apr 21 at 16:38
87

Before Debian 11 / Ubuntu 20.10, the ubuntu package name was qt5-default.

This package was deprecated and now you should install qtbase5-dev, or one of the individual Qt modules if you just want the runtime:

  • libqt5concurrent5
  • libqt5core5a
  • libqt5dbus5
  • libqt5gui5
  • libqt5network5
  • libqt5printsupport5
  • libqt5sql5
  • libqt5test5
  • libqt5widgets5
  • libqt5xml5

The corresponding Qt6 package is qt6-base-dev (note the extra -).

3
  • 6
    Installing the qtcreator package will also give you the IDE.
    – code_dredd
    Jan 8, 2018 at 10:13
  • 1
    If for some reason you need the lower Qt 4 version, qt4-default is also available. Apr 14, 2020 at 0:29
  • 1
    this package no longer exists! Apr 21 at 16:38
4

In Ubuntu 18.04 the QtCreator examples and API docs missing, This is my way to solve this problem, should apply to almost every Ubuntu release.

For QtCreator and Examples and API Docs:

sudo apt install `apt-cache search 5-examples | grep qt | grep example | awk '{print $1 }' | xargs `

sudo apt install `apt-cache search 5-doc | grep "Qt 5 " | awk '{print $1}' | xargs`

sudo apt-get install build-essential qtcreator qt5-default

If something is also missing, then:

sudo apt install `apt-cache search qt | grep 5- | grep ^qt | awk '{print $1}' | xargs `

Hope to be helpful.

Also posted in Ask Ubuntu: https://askubuntu.com/questions/450983/ubuntu-14-04-qtcreator-qt5-examples-missing

3

Also take a look at awesome project aqtinstall https://github.com/miurahr/aqtinstall/ (it can install any Qt version on Linux, Mac and Windows machines without any interaction!) and GitHub Action that uses this tool: https://github.com/jurplel/install-qt-action

0

Download latest from your Qt account next in terminal

chmod +x qt-unified-linux-x64-4.6.0-online.run 
./qt-unified-linux-x64-4.6.0-online.run 

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