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?

3 Answers 3


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

ppa:canonical-qt5-edgers/ubuntu1204-qt5 Launchpad logo (Click here for instructions on using PPAs.)

You can usually do this with the following commands:

sudo apt-add-repository ppa:canonical-qt5-edgers/ubuntu1204-qt5
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

Previously these packages were located here:

ppa:ubuntu-sdk-team/ppa Launchpad logo

According to the "Ubuntu SDK Team": Old Ubuntu 12.04 LTS Qt 5.0 packages have been moved to https://launchpad.net/~canonical-qt5-edgers/+archive/ubuntu/ubuntu1204-qt5/, and that seems to have occurred sometime in May of 2016.

  • 1
    Adding that repository now suggests you should use "apt-add-repository ppa:ubuntu-sdk-team/ppa" instead. Aug 5, 2013 at 12:14
  • 1
    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, 2014 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 forum.qt.io/topic/31293/…
    – interfect
    Apr 21, 2015 at 23:42
  • Will this work for ubuntu 14.04.04 LTS as well? May 26, 2016 at 7:53

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).


  1. Choose a PPA

    From Stephan's profile page on Launchpad, choose the PPA that matches the Qt version you want and the Ubuntu version you have. Remember that Precise is Ubuntu 12.04 and Trusty is Ubuntu 14.04.

    Supposing you want to install Qt 5.5 on Ubuntu 12.04 you should choose Qt 5.5.1 for /opt Precise (the latest Qt version available for Precise at the time of this writing).

    To install Qt 5.5 on Ubuntu 14.04 choose Qt 5.5.1 for /opt Trusty.

  2. Add the PPA to your system

    Open the PPA page. You should see something like this:

    enter image description here

    Then run apt-add-repository followed by the bold text from above (use the actual PPA address from the PPA page!):

    sudo apt-add-repository ppa:beineri/opt-qt551
  3. Update package lists an install Qt

    Run the following to download the package list from the added repository and install Qt (and Qt Creator):

    sudo apt-get update
    sudo apt-get install qt-latest qtcreator-latest
  • Stephan's PPA helped me resolve an unresolved qDebug() symbol issue on 14.04.3 where my compiled library version was 5.5.0 but my run-time was 5.2.1 (on a different machine). I installed qt55declarative and then used source /opt/qt55/bin/qt55-env.sh before running my program.
    – Lucas
    Dec 11, 2015 at 19:46
  • Will this work on 14.04 or 16.04?
    – Suici Doga
    Feb 8, 2016 at 2:37
  • @SuiciDoga Answer updated. There are PPAs for Ubuntu 14.04, but not for 16.04 (yet). Feb 8, 2016 at 15:01
  • W: Failed to fetch ppa.launchpad.net/beineri/opt-qt551/ubuntu/dists/trusty/main/… 404 Not Found
    – owais
    Feb 17, 2016 at 14:02

The way to install Qt 5.*:

sudo apt-get install build-essential libgl1-mesa-dev
  • 2
    -1 This installs a compiler suite and development files for OpenGL, not Qt. Dec 20, 2015 at 11:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .