Site Overlay

Getting the latest Qt Creator for Ubuntu

qticonOne of the rather annoying things with Ubuntu is the slow update policy for packages in the official repos. To be fair, Canonical’s reluctance to put updates into the official repositories also has an important upside which is stability and performance. Sometimes, though, you have to force an update. This was the case, when my Qt Creator stopped working after I upgraded my distro. Here’s how to get a stable Qt Creator again.

The problem: Qt Creator crashes

When I tried to work on a Qt Creator project after upgrading my distro from Trusty to Xenial, I suddenly had segfault crashes when trying to edit a source file. It was enough to begin typing a line in a source file, and Qt Creator would crash.

The first thing I did was to replace the outdated Qt Creator 3.5.1 by the Qt’s current Qt package which includes Qt 5.7 and Qt Creator 4.1.0. This is a frequently recommended procedure for Ubuntu users: Go to Qt’s website, download the installer, make it executable, run it, install it – and you are fine. Here’s why it did not work for me:

  • First of all, the installer forces you to register with Qt – something I don’t like at all and which is a deviation from Qt’s former policy. Even though I don’t have any problem with Qt having my email address on my mailing list, I have the problem with the idea, that a disgruntled employee one day steals Qt’s contact data base and sells these addresses to whatever seller of herbal Viagra who is willing to pay for it.
  • The installer will try to install everything under your home directory. Although it is possible to choose another location, you run into a lot of trouble with file permissions if you try to put it under the usual /usr/lib/x86_64-linux-gnu directory. Apart from the fact that for the sake of good order home directories should not be abused for holding program binaries and libraries, it is another disadvantage if you have partitioned your system in a way that program files reside under /usr and /opt on a quick SSD and data resides in your /home on a conventional hard drive.
  • Even after accepting these inconveniences, the desired result wasn’t obtained. Although the new Qt Cretor did not crash, the binaries I compiled from my sources lateron would. No idea what that was related to, but I uninstalled everything again (fortunately there was an executable file called MaintenanceTool under the Qt directory in your home that will do the trick)

There have been reports of sudden random crashes for earlier distros but I could not find any specific advice how to avoid my kind of crashes. As I had a Manjaro machine, I tried to find out whether my sources would

The alternative solution that worked for me

Fortunately, there is a Qt 5.8 PPA by Stephan Binner on the launchpad: It installs everything under /opt/qt57 (I would have preferred the standard /usr/lib/x86_64-linux-gnu, but I can live with that, too),it includes the most recent Qt Creator, so we give it a shot.

Update GCC

Before we start though, we update our GCC compiler to the most recent version as described in my previous article. Keep in mind that libraries that will later be linked into your Qt project which were compiled with the old compiler may be recompiled, too.

Install full Qt 5.7 suite

After that we proceed as follows which will download and install a whopping 900 MB on your hard drive:

After that, your Qt creator should launch. Depending on wether you import an existing project from another machine, you might need to fiddle around with the build settings. This is the case when after opening Qt complains that it has not found and build kit.