1

I am following this link to install Qt on my PC.

When I type sudo apt-get install build-essential g++ libqt4-core libqt4-dev libqt4-gui qt4-doc qt4-designer, I get this error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
g++ is already the newest version (4:5.3.1-1ubuntu1).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libqt4-core : Depends: libqt4-dbus (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
           Depends: libqt4-network (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
           Depends: libqt4-script (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
           Depends: libqt4-test (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
           Depends: libqt4-xml (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
           Depends: libqtcore4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
libqt4-gui : Depends: libqt4-designer (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
          Depends: libqt4-opengl (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
          Depends: libqt4-svg (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
          Depends: libqtgui4 (= 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.

I followed this link for help but after typing this command sudo apt install libqt4-designer libqt4-opengl libqt4-svg libqtgui4 libqtwebkit4, I am supposed to make a script file but i can't understand properly how to do that.

This command ran successfully sudo apt-get install libqglviewer-dev libqglviewer2 but this sudo apt-get install libboost1.48-all-dev didn't, i got this error:

Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package libboost1.48-all-dev E: Couldn't find any package by glob 'libboost1.48-all-dev' E: Couldn't find any package by regex 'libboost1.48-all-dev'

The output of apt-cache policy libqtcore4 is: libqtcore4: Installed: 4:4.8.7+dfsg-5ubuntu2 Candidate: 4:4.8.7+dfsg-5ubuntu2 Version table: *** 4:4.8.7+dfsg-5ubuntu2 500 500 http://pk.archive.ubuntu.com/ubuntu xenial/main amd64 Packages 100 /var/lib/dpkg/status 4:4.8.6+git64-g5dc8b2b+dfsg-3+deb8u1 500 500 http://ftp.ca.debian.org/debian jessie/main amd64 Packages

How can all of this be fixed?

  • Please add output of apt-cache policy libqtcore4 to the question. Normal Qt packages should not have deb8u1 suffix. From where did you get them? – N0rbert Nov 14 '18 at 20:26
  • @N0rbert I added the output of apt-cache policy libqtcore4. I got no packages from anywhere. I installed ubuntu 16.04 and started installing softwares. You want me to download qt4-x11 packages from the link you have provided? – Kamil Hassaan Nov 15 '18 at 5:01
  • If you are running plain Ubuntu 16.04 LTS (xenial), then you should remove all Debian jessie mentions from your sources.list files. And then retry. – N0rbert Nov 15 '18 at 7:19
  • Added my above comment as answer. You can accept it to help future readers. – N0rbert Nov 16 '18 at 8:01
0

As you are running plain Ubuntu 16.04 LTS (xenial), then you should remove all Debian jessie mentions from your /etc/apt/sources.list and /etc/apt/sources.list.d/ files.

You can find such files with:

grep -r jessie /etc/apt/sources.list /etc/apt/sources.list.d/*.list

then comment out problematic lines by adding # to the start and retry:

sudo apt-get update
sudo apt-get install build-essential g++ libqt4-core libqt4-dev libqt4-gui qt4-doc qt4-designer

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.