How to install Qt6 on Ubuntu 21.10
When trying to open a program that requires Qt6, it gives error while loading shared libraries: libQt6Network.so.6: cannot open shared object file: No such file or directory . I tried installing Qt6 by going to the Qt website -> Downloads for open source users -> Download the Qt Online Installer -> Qt Online Installer for Linux (64-bit), then in the installer itself I selected «Qt 6.2 for desktop development». After it’d finished installing I restarted and tried to open the program again, and it still gave the same error. I’d also seen sudo apt install qt6-base-dev be suggested so I tried that, but that just gives the error Unable to locate package qt6-base-dev , so now I’m not sure what else I could try.
asked Apr 24, 2022 at 21:24
223 1 1 gold badge 2 2 silver badges 5 5 bronze badges
2 Answers 2
libqt6network6 is indeed part of the qt6-base-dev meta-package and you can install it like so:
sudo apt install qt6-base-dev
However, unfortunately, this meta-package is not available for Ubuntu 21.10. It is currently available only for Ubuntu 22.04
Getting Started with Qt for Android
The video below is a beginner’s guide to using the Qt for Android toolchain, including the Qt Creator IDE, to get you started developing Android apps.
The rest of this page has more detailed getting started information. To download and install Qt for Android, follow the instructions on the Getting Started with Qt page.
Android Development Prerequisites
- Java Development Kit (JDK) for Java development
- Android SDK Command Line Tools for managing dependencies required for developing with Qt for Android, including:
- Android SDK Platform
- Android SDK Platform Tools
- Android SDK Build Tools
- Android NDK
The easiest way to manage these dependencies is by using Qt Creator’s built in Android development setup. For more information, see Qt Creator: Specifying Android Device Settings.
Manually Installing the Prerequisites
If you prefer to manually install the prerequisites please follow these next steps.
Java Development Kit (JDK)
Qt for Android development requires JDK 11 or above, provided by any of the following supported distributions:
Please install your preferred JDK, and then make sure the JAVA_HOME environment variable is pointing to the location of the installed JDK.
For example for Linux:
sudo apt-get install openjdk-11-jdk export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
brew install openjdk@11 sudo ln -sfn "$(brew --prefix openjdk@11)/libexec/openjdk.jdk" "/Library/Java/JavaVirtualMachines/openjdk-11.jdk" export JAVA_HOME="$(/usr/libexec/java_home -v 11)"
Android SDK Command Line Tools
Install the latest version of the Android SDK Command Line Tools for your operating system, and verify that the installation succeeded by running the sdkmanager binary:
sdkmanager --version
Then make sure the ANDROID_SDK_ROOT environment variable is pointing to the location of the installed command line tools.
For example for macOS:
brew install android-commandlinetool export ANDROID_SDK_ROOT="$(brew --prefix)/share/android-commandlinetools"
Android SDK
The required version of the Platform, Platform Tools, and Build Tools for 6.6 is 33.
To install all of these run the following command:
sdkmanager "platforms;android-33" "platform-tools" "build-tools;33.0.0"
Android NDK
The required version of the Android NDK for 6.6 is 25.1.8937393.
To install the NDK run the following command:
sdkmanager "ndk;25.1.8937393"
Then make sure the ANDROID_NDK_ROOT environment variable is pointing to the location of the installed NDK.
For example for macOS:
export ANDROID_NDK_ROOT="$(brew --prefix)/share/android-commandlinetools/ndk/25.1.8937393/"
Emulator
If you wish to use the Android Emulator, you can install it by running:
sdkmanager "emulator" "patcher;v4"
Platform Specific Configurations
Windows
The default USB driver on Windows does not allow debugging using Android Debug Bridge (ADB) tool. You must install the additional USB driver provided by the extras Android SDK package. To install it, run the following:
sdkmanager.bat "extras;google;usb_driver"
After the package installation is complete, install the driver from /extras/google/usb_driver . Try running a few basic adb commands now and check whether your Android device responds to them.
Linux
The following dependencies are needed for using tools such as adb or gdb which can be used by Qt Creator:
sudo apt-get install libstdc++6 libncurses5
To run the Android emulator, the following dependencies are also necessary:
sudo apt-get install libsdl1.2debian
Testing Your Setup
Now you can test your development setup by running the examples shipped with the Qt installation. For more information, see Mobile Examples.
To develop a simple application from scratch, see Qt Creator: Creating a Mobile Application.
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.
Get and Install Qt
You can get Qt, its modules and tools via Qt Online Installer or Qt Maintenance Tool.
Via Qt Online Installer you can do new installations. Qt Maintenance Tool is included in each Qt installation and with it you can update your Qt installation for example by adding and removing components.
You can use Qt Online Installer and Qt Maintenance Tool via a graphical user interface or a command line interface. The command line interface enables installing and uninstalling without any user interaction, that is, unattended usage.
Using Qt Online Installer
You can download Qt Online Installer via Qt Account as follows:
- Select Downloads
- Download Qt Online Installer for your host: Linux, macOS, or Windows
See Get and Install Qt with Qt Online Installer for more information about how to use Qt Online Installer.
Get and Install Qt with Command Line Interface describes how you can use Qt Online Installer with the command line interface.

Using Qt Maintenance Tool
Once Qt is installed, you can use Qt Maintenance Tool under to add components and to update or remove installed components. Qt Maintenance Tool is included in each Qt installation.
For more information about how to use Qt Maintenance Tool with the command line interface, see Get and Install Qt with Command Line Interface.

© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.
Qt for Linux/X11
Qt’s support for different Linux platforms is extensive and mature.
To download and install Qt for Linux, follow the instructions on the Getting Started with Qt page.
Supported Configurations
The following configurations are supported.
Distribution Architecture Compiler Notes Red Hat 8.6 x86_64 GCC 10 (toolset) Red Hat 8.8 x86_64 GCC 10 (toolset) Red Hat 9.2 x86_64 GCC 11 openSUSE 15.5 x86_64 GCC 9 SUSE Linux Enterprise Server 15 SP5 x86_64 GCC 10 Ubuntu 22.04 x86_64 GCC as provided by Canonical, GCC 11.x Requirements for Development Host
The Qt installers for Linux assume that a C++ compiler, debugger, make, and other development tools are provided by the host operating system. In addition, building graphical Qt applications requires OpenGL libraries and headers installed. Most Linux distributions do not install all of these by default, but setting up a development environment is still straightforward.
Use the following commands to install the basic requirements for building Qt applications:
Debian/Ubuntu (apt-get)
sudo apt-get install build-essential libgl1-mesa-dev
Fedora/RHEL/CentOS (yum)
sudo yum groupinstall "C Development Tools and Libraries" sudo yum install mesa-libGL-devel
openSUSE (zypper)
sudo zypper install -t pattern devel_basis
Building Qt from Source
You can also build Qt from the source package and configure it according to your target platform. The source packages are obtained from http://www.qt.io/download/.
Below, you will find more information about building Qt from source.
- Qt for X11 Requirements
- Qt for Linux/X11 — Building from Source
Deployment and Other Issues
The pages below covers specific issues and recommendations for creating Linux/X11 applications.
- Qt for Linux/X11 — Deployment
- Qt for Linux/X11 — Specific Issues
Where to Go from Here
We invite you to explore the rest of Qt. We prepared overviews which help you decide which APIs to use and our examples demonstrate how to use our API.
- Qt Overviews — list of topics about application development
- Examples and Tutorials — code samples and tutorials
- Qt Reference Pages — a listing of C++ and QML APIs
Qt’s vibrant and active community site, http://qt.io houses a wiki, a forum, and additional learning guides and presentations.
© 2023 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.