How to install Qt on Ubuntu?
To install Qt on Ubuntu, you can follow these steps:
- Open the terminal.
- Add a software repository for Qt. Use the following command:
sudo add-apt-repository ppa:beineri/opt-qt-5.12.3-xenial
- Update the software package list. Execute the following command:
sudo apt update
- Install Qt. Run the following command:
sudo apt install qt512-meta-minimal
- Set up environment variables. Run the following command:
echo 'source /opt/qt512/bin/qt512-env.sh' >> ~/.bashrc
source ~/.bashrc
- 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.