How to fix Qt5 unmet dependencies
https://askubuntu.com/questions/880028/how-to-fix-qt5-unmet-dependencies
I'm running Ubuntu 16.10 with Qt4.8.7 and I'd like to install Qt5 in order to compile a package. I installed qt5-qmake from the repo, and set the default to qt5:
export QT_SELECT=qt5
./configure && make
...fatal error: QtCore/QTextCodec: No such file or directory
So the package wouldn't compile, apparently because of an include statement:
include "<"QtCore/QtGlobal
for which I think I need the development environment. First, I tried to install it from the Qt site, by downloading qt-opensource-linux-x64-5.6.1.run, then I tried to install qtbase5-dev from Synaptic.
That didn't work because of unmet dependencies. All the installed files mentioned are ubuntu7-2 versions from the main Ubuntu Yakkety repo; the required ubuntu6-4 versions are also available. They are also used in a great many other packages which I can't afford to break.
$ sudo aptitude install qtbase5-dev
The following NEW packages will be installed: libegl1-mesa-dev{a} libgles2-mesa-dev{a} libglu1-mesa-dev{a} libmirclient-dev{ab} libmircommon-dev{ab} libmircookie-dev{ab} libprotobuf-dev{a} libqt5opengl5-dev{ab} libwayland-bin{a} libwayland-dev{a} libxkbcommon-dev{a} qt5-qmake{a} qtbase5-dev{b} qtbase5-dev-tools{a}
0 packages upgraded, 14 newly installed, 0 to remove and 8 not upgraded.
Need to get 4,473 kB of archives. After unpacking 33.6 MB will be used.
The following packages have unmet dependencies:
libqt5opengl5-dev : Depends: libqt5opengl5 (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
libmirclient-dev : Depends: libmirclient9 (= 0.24.0+16.10.20160815.3-0ubuntu2) but 0.24.1+16.10.20160928-0ubuntu1 is installed
libmircommon-dev : Depends: libmircommon6 (= 0.24.0+16.10.20160815.3-0ubuntu2) but 0.24.1+16.10.20160928-0ubuntu1 is installed
qtbase5-dev : Depends: libqt5concurrent5 (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
Depends: libqt5core5a (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
Depends: libqt5dbus5 (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
Depends: libqt5gui5 (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
Depends: libqt5network5 (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
Depends: libqt5printsupport5 (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
Depends: libqt5sql5 (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
Depends: libqt5test5 (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
Depends: libqt5widgets5 (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
Depends: libqt5xml5 (= 5.6.1+dfsg-3ubuntu6~4) but 5.6.1+dfsg-3ubuntu7~2 is installed
libmircookie-dev : Depends: libmircookie2 (= 0.24.0+16.10.20160815.3-0ubuntu2) but 0.24.1+16.10.20160928-0ubuntu1 is installed
The following actions will resolve these dependencies:
Keep the following packages at their current version: 1) libegl1-mesa-dev [Not Installed] 2) libgles2-mesa-dev [Not Installed]
3) libmirclient-dev [Not Installed]
4) libmircommon-dev [Not Installed]
5) libmircookie-dev [Not Installed]
6) libqt5opengl5-dev [Not Installed]
7) qtbase5-dev [Not Installed]
Accept this solution? [Y/n/q/?] ?
Apt-get's solution is to leave it unchanged.
It seems odd that the main repo version of Qt 5.6.1 requires different libraries to the other packages.
It looks like I need to downgrade these libraries from 7.2 to to 6.4. Can I do this safely, and install Qt 5.6.1? Or is there a better way to fix the problem?
$ apt-cache policy libqt5core5a
libqt5core5a:
Installed: 5.6.1+dfsg-3ubuntu7~2
Candidate: 5.6.1+dfsg-3ubuntu7~2
Version table:
*** 5.6.1+dfsg-3ubuntu7~2 100
100 /var/lib/dpkg/status
5.6.1+dfsg-3ubuntu6~4 500
500 http://mirrors.psu.ac.th/ubuntu yakkety/main amd64 Packages
I eventually sorted this out by using Synaptic to force the qtbase5-dev dependencies to the previous (Yakkety-upgrades or Yakkety) versions.
This left the libmir files. Manually installing them failed, but shows the problematic dependencies. Repeating for the dependencies and working down through them eventually led to one or two files which needed to be downgraded.
Forcing that via Synaptic also removed a host of basic Yakkety applications; it's a pity I couldn't find a way to downgrade them in parallel, keeping a consistent system, but in the end I let them go, installed Qt5, and manually reinstalled the missing packages by using Synaptic's Status 'Not installed (residual config)' section to identify and reinstall them.
I had a couple of minor issues with security-related packages on reboot, but quickly solved with Google.