libqt4-dev cannot be installed and breaks package manager

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,

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  libmysqlclient-dev libpq-dev libsqlite3-dev unixodbc-dev
The following NEW packages will be installed:
  libqt4-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
39 not fully installed or removed.
Need to get 0 B/2,516 kB of archives.
After this operation, 18.0 MB of additional disk space will be used.
(Reading database ... 416905 files and directories currently installed.)
Unpacking libqt4-dev (from .../libqt4-dev_4%3a4.8.1-0ubuntu4.4_i386.deb) ...
dpkg: error processing /var/cache/apt/archives/libqt4-dev_4%3a4.8.1-0ubuntu4.4_i386.deb (--unpack):
 trying to overwrite '/usr/bin/uic3', which is also in package qtchooser 0.0.1~git20121229.g8f08405-0ubuntu1~precise1~test5
dpkg-deb (subprocess): subprocess data was killed by signal (Broken pipe)
dpkg-deb: error: subprocess <decompress> returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libqt4-dev_4%3a4.8.1-0ubuntu4.4_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

How do I fix this?

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


Go to Source of this post
Author Of this post: nik90
Title Of post: libqt4-dev cannot be installed and breaks package manager
Author Link: {authorlink}