How to install Qt on Ubuntu?

To install Qt on Ubuntu, you can follow these steps:

  1. Open the terminal.
  2. Add a software repository for Qt. Use the following command:
sudo add-apt-repository ppa:beineri/opt-qt-5.12.3-xenial
  1. Update the software package list. Execute the following command:
sudo apt update
  1. Install Qt. Run the following command:
sudo apt install qt512-meta-minimal
  1. Set up environment variables. Run the following command:
echo 'source /opt/qt512/bin/qt512-env.sh' >> ~/.bashrc
source ~/.bashrc
  1. Validate the installation. Execute the following command:
qmake --version

If the Qt version information is displayed, it means the installation was successful.

Note: The above steps are suitable for Ubuntu 16.04 (Xenial Xerus). If you are using a different version of Ubuntu, please choose the corresponding Qt software source based on the actual situation.

bannerAds