How to Install Qt SDK on Ubuntu Linux

First determine your Ubuntu Linux operating system bit version by opening up a terminal and typing the following below and download the matching Qt SDK bit version for your operating system., Next download the Qt Software Development Kit (SDK)...

23 Steps 3 min read Advanced

Step-by-Step Guide

  1. Step 1: First determine your Ubuntu Linux operating system bit version by opening up a terminal and typing the following below and download the matching Qt SDK bit version for your operating system.

    For example, if you are on 32-bit Ubuntu Linux then download 32-bit Qt SDK, if you are on 64-bit Ubuntu Linux then download 64-bit Qt SDK.

    Type/Copy/Paste: file /sbin/init Note the bit version of your Ubuntu Linux operating system architecture it will display whether it is 32-bit or 64-bit.
  2. Step 2: Next download the Qt Software Development Kit (SDK) Download Qt SDK Select your Ubuntu Linux system architecture such as 32-bit or 64-bit version of the Qt SDK.

    Also you can add development libraries so that you are able to run Qt applications without complications by following these steps.

    Note:
    When it comes to downloading the SDK, download the offline installation due to the fact it takes a long time to download unless you have a really fast download connection.

    You have two methods when it comes to downloading the Qt SDK the online installer method or the offline installer method.

    I prefer to just download the full SDK using the offline method.

    Because the classes that make up Qt SDK are so large it takes several hours on a slow connection to download the SDK.

    This may or may not be a turn off for some users who want to try out the Qt SDK.

    Suggestion:
    I would strongly recommend using the offline installer instead of the online installer unless you have a really fast connection. , Type/Copy/Paste: sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui This command adds additional Qt development libraries to your Ubuntu Linux system allowing Qt programs to run smoothly on your system. ,,,, Select /opt and your Qt SDK will install into a directory called /opt/QtSDK,,,, Type/Copy/Paste: sudo
    -s nano /etc/profile or Type/Copy/Paste: sudo
    -s gedit /etc/profile , You want to add this line below to your /etc/profile system wide file so that you will have the option to compile Qt programs from the terminal line.,, The Qt SDK is always improving with new version changes.

    So make sure you are mindful of your Qt SDK version number.

    For example, we are using Qt version
    4.8.1 in this example, therefore the version number in the /etc/profile would reflect as
    4.8.1. ,, /etc/profile Make sure you enter a . and then a space in order to reload your /etc/profile file ,,,,, Now you are all set to compile Qt programs on your Ubuntu Linux system.

    Once the Qt SDK is successfully installed on your system you might want to try compiling your first Qt program see this document for more information How to Create Your First Qt Program on Ubuntu Linux.
  3. Step 3: Open up a terminal and enter the following commands below: Type/Copy/Paste: sudo apt-get install synaptic Type/Copy/Paste: sudo apt-get update This command is used to update and to resynchronize the package index files from their sources via the Internet.

  4. Step 4: Type/Copy/Paste: cd /home/"your_user_name"/Downloads This will change you into the Downloads directory on your system

  5. Step 5: Type/Copy/Paste: sudo -s chmod u+x QtSdk-offline-linux-x86_64-v1.2.1.run This will make the Qt SDK executable for all users on your system

  6. Step 6: Install the Qt SDK by issuing the following command Type/Copy/Paste: sudo -s ./QtSdk-offline-linux-x86_64-v1.2.1.run -style cleanlooks You must have superuser privileges to install the Qt SDK

  7. Step 7: When you install the Qt SDK you will prompted to select a directory where you want the Qt SDK to reside.

  8. Step 8: Change the permissions on the Qt SDK directory location to be available by all users by issuing the following command

  9. Step 9: Type/Copy/Paste: sudo -s chmod -R 777 /opt/QtSDK This will make the Qt SDK executable for all users on your system

  10. Step 10: Type/Copy/Paste: sudo -s chmod -R 777 /home/"your_user_name"/.config/Nokia This will prevent error messages when you start QtCreator

  11. Step 11: stating it can not write to the /home/"your_user_name"/.config/Nokia directory.

  12. Step 12: Once the Qt program is installed

  13. Step 13: open up a terminal and use a text editor such as nano or gedit to edit your /etc/profile.

  14. Step 14: Scroll down to the end of the /etc/profile file and enter the following text below.

  15. Step 15: Type/Copy/Paste: PATH=/opt/QtSDK/Desktop/Qt/4.8.1/gcc/bin:$PATH export PATH

  16. Step 16: The above number highlighted in bold denotes the version number of the Qt SDK so make sure you enter the correct version number of the Qt SDK.

  17. Step 17: Save the /etc/profile file and exit

  18. Step 18: Reload the /etc/profile file by issuing the following command Type/Copy/Paste: .

  19. Step 19: Once the /etc/profile file is reloaded issue the following command you can type the following commands to make sure your Ubuntu Linux system recognizes that the Qt SDK has been accepted by the system PATH.

  20. Step 20: Type/Copy/Paste: which qmake You should receive a response such as the one below /opt/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake

  21. Step 21: Also type the following command below: Type/Copy/Paste: qmake -version

  22. Step 22: You should receive a response similar to this: 'QMake version 2.01a 'Using Qt version 4.8.1 in /opt/QtSDK/Desktop/Qt/4.8.1/gcc/lib

  23. Step 23: This lets you know that you are able to compile Qt programs from the command line.

Detailed Guide

For example, if you are on 32-bit Ubuntu Linux then download 32-bit Qt SDK, if you are on 64-bit Ubuntu Linux then download 64-bit Qt SDK.

Type/Copy/Paste: file /sbin/init Note the bit version of your Ubuntu Linux operating system architecture it will display whether it is 32-bit or 64-bit.

Also you can add development libraries so that you are able to run Qt applications without complications by following these steps.

Note:
When it comes to downloading the SDK, download the offline installation due to the fact it takes a long time to download unless you have a really fast download connection.

You have two methods when it comes to downloading the Qt SDK the online installer method or the offline installer method.

I prefer to just download the full SDK using the offline method.

Because the classes that make up Qt SDK are so large it takes several hours on a slow connection to download the SDK.

This may or may not be a turn off for some users who want to try out the Qt SDK.

Suggestion:
I would strongly recommend using the offline installer instead of the online installer unless you have a really fast connection. , Type/Copy/Paste: sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui This command adds additional Qt development libraries to your Ubuntu Linux system allowing Qt programs to run smoothly on your system. ,,,, Select /opt and your Qt SDK will install into a directory called /opt/QtSDK,,,, Type/Copy/Paste: sudo
-s nano /etc/profile or Type/Copy/Paste: sudo
-s gedit /etc/profile , You want to add this line below to your /etc/profile system wide file so that you will have the option to compile Qt programs from the terminal line.,, The Qt SDK is always improving with new version changes.

So make sure you are mindful of your Qt SDK version number.

For example, we are using Qt version
4.8.1 in this example, therefore the version number in the /etc/profile would reflect as
4.8.1. ,, /etc/profile Make sure you enter a . and then a space in order to reload your /etc/profile file ,,,,, Now you are all set to compile Qt programs on your Ubuntu Linux system.

Once the Qt SDK is successfully installed on your system you might want to try compiling your first Qt program see this document for more information How to Create Your First Qt Program on Ubuntu Linux.

About the Author

J

Joshua Mitchell

Experienced content creator specializing in home improvement guides and tutorials.

71 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: