0

I just installed Ubuntu 12.04 over 10.04. It seemed to go OK until I tried running my updates. When I launch Software Center I get the following error message:

Items cannot be installed or removed until the package catalogue is repaired. Do you want to repair it now?

Once Update Manager has finished the repairs, you can close it and return to the store.

So I hit repair and then I get this message:

Package operation failed

The installation or removal of a software package failed.

So I hit OK and it goes back to the first error message

And it just continues repeating those two messages. How do I fix whatever is broken? I reviewed answers for similar questions. I tried the suggestions in that link but they did not work. I tried to post the results but, being new to this system I am not allowed to post more than 2 links. However, it seems the crux of the problem is this:

(Reading database ... 742676 files and directories currently installed.)
Removing libxml-libxml-perl ...
/var/lib/dpkg/info/libxml-libxml-perl.prerm: 11: /var/lib/dpkg/info/libxml-libxml-perl.prerm: update-perl-sax-parsers: not found
dpkg: error processing libxml-libxml-perl (--remove):
 subprocess installed pre-removal script returned error exit status 127
Errors were encountered while processing:
 libxml-libxml-perl
E: Sub-process /usr/bin/dpkg returned an error code (1)
Bryan
  • 1
  • 3

2 Answers2

0

I always recommend doing a clean installation. I don't have deep knowledge on this, but I think that you should delete all of the PPAs that you had registered before.

Then, run sudo apt-get update and reboot.

After rebooting, run sudo apt-get update again and then sudo apt-get upgrade.

If this doesn’t work, I think that there are programs that could be useful to remake your /etc/apt/sources.list.

chaskes
  • 15,246
upiferico
  • 31
  • 5
0

When is a big update like that, I always recommend format HDDs and install all from 0, and with more reason if we are talking about Linux.

You can edit the two last lines of your /etc/apt/sources.list

And,

Try this:

sudo apt-get update

That will update your system software list.

And then,

sudo apt-get install -f

That should fix your packages.

If it doesn't, then you've got a broken package manager, and I'd recommend reinstalling - but only if you've tried everything else!!!

Also:

Try

sudo apt-get update

to update your package list. Then

sudo apt-get autoclean

to clean up any partial packages. Then

sudo apt-get clean

to clean up the apt cache.

sudo apt-get autoremove

will clean up any unneeded dependencies. If while doing this you can identify the broken package this code will very forcefully remove it.

sudo dpkg --remove -force --force-remove-reinstreq package name

Change package name to the real name of course.

Regards!

  • Does this mean the broken package is libxml-libxml-perl? And if so, is it safe to remove that package with force? The following packages have unmet dependencies: libxml-libxml-perl : Depends: perlapi-5.10.0 but it is not installable Depends: libxml-sax-perl but it is not installed E: Unmet dependencies. Try using -f. – Bryan Jul 10 '13 at 20:09
  • I think it is safe, but I can't test it. In any case, you know what you do, and how repair it, reinstalling what you forced to remove. –  Jul 10 '13 at 22:43
  • Running sudo dpkg --remove -force --force-remove-reinstreq package name I got this error dpkg: error: conflicting actions -f (--field) and -r (--remove) – Bryan Jul 18 '13 at 07:22