My qtcreator was not working properly and was missing things like examples, tutorials etc. So I basically decided to do a clean install of all qt5 packages. I ppa-purge the official ubuntu-sdk ppa and tried to reinstall everything.

I added the 2 ppa mentioned in developer.ubuntu.com. I installed qtcreator and now it all works. However when I tried to update my 12.04 system, I now see the error message that there is an unmet dependency.

On running sudo apt-get dist-upgrade I get the following error output,

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
libqt4-opengl-dev : Depends: libqt4-dev (= 4:4.8.1-0ubuntu4.4) but it is not installed
libqtwebkit-dev : Depends: libqt4-dev (>= 4:4.8.0~) but it is not installed
E: Unmet dependencies. Try using -f.

So it seems that libqt4-dev is not installed. I try installing it based on the error message by sudo apt-get -f install libqt4-dev. But then I get this error message,

[EDIT 1]: In response to asclepix's anser, I tried removing qtchooser by sudo apt-get remove qtchooser, however the output I get is,

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libqt4-opengl-dev : Depends: libqt4-dev (= 4:4.8.1-0ubuntu4.4) but it is not going to be installed
libqtwebkit-dev : Depends: libqt4-dev (>= 4:4.8.0~) but it is not going to be installed
qt5-default : Depends: qtchooser but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

2 Answers
2

trying to overwrite '/usr/bin/uic3', which is also in package qtchooser 0.0.1~git20121229.g8f08405-0ubuntu1~precise1~test5

I've got qt4 and qt4-dev, but no qtchooser (perhaps because I'm in 12.10). I think this package is to choose between qt3 and qt4 or qt5. If it's possible (have you got qt3? qt5?), try to disinstall qtchooser.

I had the same problem on my computer after the installation of Ubuntu SDK. I foudn the solution here.
Your have to follow step with the PPA, I put the solution here but I advise you to follow the tutorial.

PPAs (Personal Package Archive) are repositories hosted on Launchpad. You can use PPAs to install or upgrade packages that are not available in the official Ubuntu repositories.

One of the most common causes of unmet dependencies are PPAs, specially when used to upgrade the existing package in Ubuntu repositories. To solve the problem you have tree options, disable, purge (revert back to original package in Ubuntu repositories) or remove PPA.

Disable:
Disabling a PPA means no more updates for the packages installed from that PPA. To disable a PPA: Open Software Center > Edit > Software Sources Or,
Hit Alt+F2 and run software-properties-gtk.
Click on Other Software tab, you'll see that each PPA have two lines here, one for the compiled packages and one for the source, Uncheck both lines to disable a PPA. Hare you can also add and remove PPAs.
Purge:
Purging a PPA means, downgrading the packages in the selected PPA to the version in the official Ubuntu repositories and disabling that PPA. PPA Purge does exactly that. To install PPA Purge run the following command:
sudo apt-get install ppa-purge

But, Considering the question apt is broken so the above command will fail. So use this command

If 'ppa-purge' command fails for some reason, you can't run 'ppa-purge' again unless you re-enable the PPA (To enable the PPA follow the same steps as disabling a PPA and Check the both lines of a particular PPA to enable it).

Note: PPA Purge doesn't remove PPAs (may be in future), So you'll have to manually remove the PPA.