Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

If you want to develop with QML 2.0 and Qt5, the base packages don't seem to exist in repository for 12.04. What PPA should I add? Is it a binary installer? a compile the toolkit yourself?

Those aren't separate questions, they're just possible tracks to an answer.

I'm asking because if you want to develop for Ubuntu Phone, but still have a rock solid LTS development box, this seems the appropriate path.

How can I install Qt 5.x on 12.04 LTS?

share|improve this question

3 Answers 3

up vote 30 down vote accepted

This can be done by adding the following PPA to your system:

ppa:ubuntu-sdk-team/ppa Launchpad logo (Click here for instructions on using PPAs.)

You can usually do this with the following commands:

sudo apt-add-repository ppa:ubuntu-sdk-team/ppa
sudo apt-get update

The next step is to install the necessary packages for Qt5 / QML 2.0 development. You can do that by running these command:

sudo apt-get install qtdeclarative5-dev

This will install the headers / libraries necessary for development with desktop Qt and QML. You will also probably want to grab the latest release of Qt Creator from this page.

I've found that Qt Creator sometimes has problems finding your new Qt5 installation. If that is the case, perform these steps:

  1. open it up and go to Tools->Options
  2. click the "Build & Run" section in the left menu
  3. click the "Qt Versions" tab
  4. click "Add..." and enter the location that corresponds with your OS:

    32-bit: /usr/lib/i686-linux-gnu/qt5/bin/qmake
    64-bit: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake

share|improve this answer
Adding that repository now suggests you should use "apt-add-repository ppa:ubuntu-sdk-team/ppa" instead. – Terence Eden Aug 5 '13 at 12:14
Is there a way to install qt 5.2 with a similar method? I think the version provided on the PPA is 5.02 – Ezequiel Mar 21 '14 at 23:52
This version of Qt is giving me segfaults on window creation, when using the AMD proprietary fglrx graphics driver. Basically as described at… – interfect Apr 21 at 23:42

The way to install Qt 5.*:

For Debian family:

sudo apt-get install build-essential libgl1-mesa-dev

For Fedora family:

sudo yum groupinstall "C Development Tools and Libraries"
sudo yum install mesa-libGL-devel

For OpenSUSE family:

sudo zypper install -t pattern devel_basis
share|improve this answer

Nathan Osman's answer is great, but Ubuntu SDK team PPA (ppa:ubuntu-sdk-team/ppa) provides only Qt 5.0 for Ubuntu 12.04.

If you need features from newer Qt versions you can use the new PPAs by Stephan Binner for Precise and Trusty. He created PPAs for all Qt version starting from 4.8.

In order to not mess with Qt system packages, the packages from this PPA are installed in /opt so you'll have to inform the correct path (/opt/qtXX/include) to your build tool (if you don't use the Qt Creator provided by the PPA).

At the moment of this writing, the latest available PPA for Ubuntu 12.04 provides the recently released Qt 5.5 and Qt Creator 3.4.2.

Instructions for installation of Qt 5.5 (and Qt Creator) on Ubuntu 12.04:

sudo apt-add-repository ppa:beineri/opt-qt55
sudo apt-get update
sudo apt-get install qt-latest qtcreator-latest
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.