How to Install Qt 5.15 onto CentOS 7

Abstract: Resolve missing Qt 5.15 packages on CentOS 7 by compiling the framework from source with required dependencies.

Created: 2026-07-31 by
Installing Qt 5.15 on CentOS 7 requires compiling the framework from source code because the default repositories only provide older versions. This guide walks you through downloading the source, configuring the build environment with necessary dependencies like GCC and OpenSSL, and compiling the toolkit to ensure compatibility with modern C++ standards and development tools on your Red Hat Enterprise Linux-based system.

Prerequisites and System Preparation

Before initiating the installation, you must ensure that your CentOS 7 system has the essential development tools installed. The build process relies heavily on a complete set of compilers and libraries. You need to update your package manager cache and install the base group for development tools. Run the following command to install the core components required for building Qt:
yum groupinstall "Development Tools"
yum install epel-release
yum install openssl-devel libxcb-devel xcb-util-wm-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel
The openssl-devel package is critical because Qt 5.15 uses OpenSSL for secure network communications. Without it, the configuration step will fail or produce warnings about missing cryptographic support. Additionally, installing the EPEL repository ensures access to additional packages that might be needed during the dependency resolution phase. It is also advisable to verify your installed GCC version, as Qt 5.15 works best with GCC 4.8.5 or newer, which is standard on CentOS 7.

Downloading the Qt Source Code

Since binary packages for Qt 5.15 are not available in the standard CentOS 7 repositories, you must download the single-file source archive. This archive contains all modules combined into one large file, simplifying the initial setup. Navigate to your preferred directory for storing source files, such as /usr/local/src, and use wget to retrieve the installer.
cd /usr/local/src
wget https://download.qt.io/archive/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz
Once the download completes, extract the archive using the tar utility. The extraction process may take a few minutes depending on your system's I/O speed. After extraction, change into the newly created directory to begin the configuration process.
tar xf qt-everywhere-src-5.15.0.tar.xz
cd qt-everywhere-src-5.15.0
This directory structure contains the configure script and all module sources. It is important to stay within this directory when running subsequent commands to ensure paths are resolved correctly relative to the source tree.

Configuring the Build Environment

The configuration step determines which features are enabled and where libraries are located. For most developers, enabling both static and shared libraries is beneficial, though static linking increases binary size significantly. You can configure the build by running the ./configure script with appropriate flags. A typical command for a general-purpose development setup looks like this:
./configure -prefix /usr/local/Qt-5.15 -opensource -confirm-license -release -shared -dbus-linked -qt-xcb -qt-pcre -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -make libs -nomake examples -nomake tests
The -prefix flag specifies the installation directory. Choose a location that does not conflict with system packages, such as /usr/local/Qt-5.15. The -opensource and -confirm-license flags automate the license acceptance for the open-source edition. The -dbus-linked flag ensures proper integration with the D-Bus messaging system, which is often used for inter-process communication in Linux desktop environments. If you encounter issues related to X11 rendering, ensure that libX11-devel and libXi-devel are installed via yum. For those who require specific database drivers or multimedia support, you can add flags like -qt-sqlite or -gstreamer. However, keeping the build minimal by excluding examples and tests (-nomake examples -nomake tests) speeds up the compilation process significantly.

Compiling and Installing

After successful configuration, the next step is to compile the source code. Use the make command with the -j option to utilize multiple CPU cores, which drastically reduces build time. Replace N with the number of cores available on your machine.
make -j$(nproc)
This process can take anywhere from 30 minutes to several hours depending on hardware performance. Once compilation finishes, install the binaries and headers by running the make install command with root privileges.
sudo make install
This copies the compiled libraries, executables, and header files to the prefix directory specified earlier. To make the Qt tools accessible from the command line, you should add the bin directory to your PATH environment variable. Add the following line to your ~/.bashrc or /etc/profile:
export PATH=/usr/local/Qt-5.15/bin:$PATH
Source your profile to apply changes immediately. Verify the installation by checking the version of qmake.
qmake --version
You should see output indicating Qt version 5.15.x. This confirms that the toolkit is correctly installed and ready for use in your development projects.

Integrating with IDEs

While command-line usage is straightforward, integrating Qt 5.15 with an IDE like Qt Creator enhances productivity. Download and install the latest version of Qt Creator compatible with your system. During the installation or within the application settings, navigate to the Kits section. Add a new Kit and select the compiler (GCC) and debugger (GDB) installed on your system. Crucially, point the QMake path to /usr/local/Qt-5.15/bin/qmake. This ensures that any new project created uses the correct Qt 5.15 libraries. For more information on managing complex build environments, you might find resources on troubleshooting virtualization guests useful, similar to guides on Issues Installing VirtualBox Guest Additions on RHEL 9 Server, as the principles of driver and library compatibility often overlap.

Frequently Asked Questions

Why can't I install Qt 5.15 using yum?

CentOS 7's default repositories contain older versions of Qt, typically around 4.8 or early 5.x releases. Newer versions like 5.15 are not included in the stable base repositories due to stability policies. Therefore, manual compilation from source is the standard method for obtaining recent Qt versions on this OS.

Do I need to uninstall previous Qt versions before installing 5.15?

No, you do not need to uninstall existing versions if they are installed in different directories. By setting a unique prefix like /usr/local/Qt-5.15, you keep the new installation isolated. Just ensure your PATH variable points to the correct version's bin directory to avoid conflicts.

What should I do if the configure script fails to find OpenGL?

Ensure that you have installed the Mesa OpenGL development libraries. On CentOS 7, these are provided by the mesa-libGL-devel and mesa-libGLU-devel packages. Install them using yum and re-run the configure script. Also, verify that your graphics drivers are properly configured for the desktop environment.

Can I use this Qt installation with Python PyQt?

Yes, but you must build PyQt5 against the same Qt 5.15 installation. You need to specify the path to the qmake executable of your custom Qt installation during the PyQt5 build process. This ensures that the Python bindings link against the correct libraries rather than system defaults.

How do I remove Qt 5.15 if I made a mistake?

If you installed to a specific prefix like /usr/local/Qt-5.15, you can simply delete that directory. Remove the corresponding entry from your PATH in .bashrc or /etc/profile and reload the shell configuration. This leaves no residual files on the system.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More