Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've managed to break apt-get, I think it had something to do with competing versions of libqt between supercollider and skype. Now when I try to install anything, I get the following:

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
 libdbusmenu-qt2:i386 : Depends: libqtcore4:i386 (>= 4:4.7.0~beta1) but it is not going to be installed
 libqt4-dbus:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed
 libqt4-declarative:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed
 libqt4-network:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed
 libqt4-script:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed
 libqt4-sql:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed
 libqt4-sql-mysql:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed
 libqt4-xml:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed
 libqt4-xmlpatterns:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed
 libqtgui4:i386 : Depends: libqtcore4:i386 (= 4:4.8.1-0ubuntu4.1) but it is not going to be installed
 skype-bin:i386 : Depends: libqtcore4:i386 (>= 4:4.5.3) but it is not going to be installed
 sni-qt:i386 : Depends: libqtcore4:i386 (>= 4:4.7.3-1ubuntu3~) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

When I run apt-get -f install I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libxml++2.6-2 libffado2 libconfig++8 libssl1.0.0:i386
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libqt4-declarative:i386 libqt4-sql-mysql libqt4-sql-mysql:i386 libqt4-test qdbus
Suggested packages:
  libqt4-declarative-folderlistmodel:i386 libqt4-declarative-gestures:i386 libqt4-declarative-particles:i386 libqt4-declarative-shaders:i386 qt4-qmlviewer:i386
  libqt4-dev libqt4-dev:i386
The following packages will be upgraded:
  libqt4-declarative:i386 libqt4-sql-mysql libqt4-sql-mysql:i386 libqt4-test qdbus
5 upgraded, 0 newly installed, 0 to remove and 449 not upgraded.
14 not fully installed or removed.
Need to get 0 B/1,236 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 183437 files and directories currently installed.)
Preparing to replace libqt4-sql-mysql 4:4.8.1-0ubuntu4.1 (using .../libqt4-sql-mysql_4%3a4.8.1-0ubuntu4.2_amd64.deb) ...
Unpacking replacement libqt4-sql-mysql ...
dpkg: error processing libqt4-sql-mysql:i386 (--configure):
 libqt4-sql-mysql:i386 4:4.8.1-0ubuntu4.1 cannot be configured because libqt4-sql-mysql:amd64 is in a different version (4:4.8.1-0ubuntu4.2)
dpkg: error processing libqt4-sql-mysql (--configure):
 libqt4-sql-mysql:amd64 4:4.8.1-0ubuntu4.2 cannot be configured because libqt4-sql-mysql:i386 is in a different version (4:4.8.1-0ubuntu4.1)
Errors were encountered while processing:
 libqt4-sql-mysql:i386
 libqt4-sql-mysql
E: Sub-process /usr/bin/dpkg returned an error code (1)

I read that I could fix this by installing aptitude and removing and reinstalling broken packages, but I can't install it using dpkg.

Please help! I'm close to wiping my drive and starting again.

share|improve this question
possible duplicate of How do I resolve unmet dependencies? – Jacob Johan Edwards Jul 25 '12 at 20:48

3 Answers

up vote 4 down vote accepted

You should be able to remove packages using dpkg directly, for example:

sudo dpkg -r libqt4-sql-mysql:i386

You can then see if the remaining packages can be configured with

sudo dpkg --configure -a

Once everything's configured successfully, apt-get should be able to install aptitude which should be able to work out a solution to fix the dependencies.

share|improve this answer
Yes, thank you so much, that fixed my problem, legend! – Will Munn Jul 25 '12 at 22:36

Just clean your cache with apt-get autoclean apt-get clean or by going to var/lib/apt/ and delete the offending files use gksu nautilus for this.

Then try again.

share|improve this answer
I have this nifty script called update.sh that does sudo apt-get check ; sudo apt-get update ; sudo apt-get upgrade ; sudo apt-get clean ; sudo apt-get autoclean ; sudo apt-get autoremove – Anonymous Jul 25 '12 at 1:21
@Anonymous There's no reason to run both sudo apt-get clean and sudo apt-get autoclean--sudo apt-get autoclean never removes anything that wouldn't be removed by sudo apt-get clean. – Eliah Kagan Jul 25 '12 at 1:54

Try these with terminal

sudo apt-get autoremove

sudo apt-get clean

sudo apt-get install -f

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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