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?
This can be done by adding the following PPA to your system:
You can usually do this with the following commands:
The next step is to install the necessary packages for Qt5 / QML 2.0 development. You can do that by running these command:
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:
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:
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.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).Instructions
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.
Add the PPA to your system
Open the PPA page. You should see something like this:
Then run
apt-add-repository
followed by the bold text from above (use the actual PPA address from the PPA page!):Update package lists an install Qt
Run the following to download the package list from the added repository and install Qt (and Qt Creator):
The way to install Qt 5.*: