0

I tried to remove unstable openoffice and reinstall libreoffice however I accidently removed directory of openoffice under /opt before I purged it. Now I cannot clean the broken package, and cannot remove/install libreoffice too. apt-get -f install doesn't work with error:

....
Errors were encountered while processing:
 /var/cache/apt/archives/libreoffice-common_1%3a4.2.7-0ubuntu2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

and I followed How to fix a broken package by removing the packages manually via dpkg but it did not remove it clean. Same problems hold still.

And I have unmet dependencies which I cannot clean or move up:

dpkg: error processing package libreoffice-calc (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libreoffice-java-common
 libreoffice-sdbc-hsqldb
 libreoffice-core
 python3-uno
 libreoffice-math
 libreoffice-impress
 libreoffice-writer
 libreoffice-base-core
 libreoffice-gnome
 libreoffice-base
 libreoffice-sdbc-firebird
 libreoffice-report-builder-bin
 libreoffice-pdfimport
 libreoffice-avmedia-backend-gstreamer
 libreoffice-gtk
 libreoffice-base-drivers
 libreoffice-draw
 libreoffice-calc

Basically they depend on a package named libreoffice-common, but I have no idea how to purge or install it.


Update:

Followed instructions from mchid and sudo apt-get install ... reports (actually they did the same things as apt-get install libreoffice) terminated with:

Selecting previously unselected package xfonts-mathml.
Preparing to unpack .../xfonts-mathml_6ubuntu1_all.deb ...
Unpacking xfonts-mathml (6ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for gnome-icon-theme (3.10.0-0ubuntu2) ...
Processing triggers for fontconfig (2.11.0-0ubuntu4.1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libreoffice-common_1%3a4.2.7-0ubuntu2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

What all I know now, is that it seems I purged everything with libreoffice and openoffice. Using command:

sudo apt-get purge libreoffice*
sudo apt-get purge openoffice*
sudo apt-get autoremove
sudo apt-get clean
sudo dpkg --configure -a #double check, reports nothing
sudo dpkg -L libreoffice
sudo dpkg -L openoffice

all of them shows they have been cleanly removed, however, I just couldn't install libreoffice, with a single line of /usr/bin/dpkg returned an error code (1).

3
  • @mchid dpkg -L openoffice shows the location.
    – knh190
    Mar 22, 2015 at 16:24
  • maybe you mean dpkg -l | grep openoffice?
    – mchid
    Mar 22, 2015 at 16:28
  • did you manually download libreoffice package? Try to redownload it?
    – sipral
    Mar 22, 2015 at 23:53

2 Answers 2

2

Assuming you are running regular ubuntu and not ubuntu-gnome, run the following commands to fix the problem:

sudo apt-get update
sudo apt-get purge openoffice* libreoffice* python3-uno
sudo apt-get install libreoffice-java-common libreoffice-sdbc-hsqldb libreoffice-core python3-uno libreoffice-math libreoffice-impress libreoffice-writer libreoffice-base-core libreoffice-gnome libreoffice-base libreoffice-sdbc-firebird libreoffice-report-builder-bin libreoffice-pdfimport libreoffice-avmedia-backend-gstreamer libreoffice-gtk libreoffice-base-drivers libreoffice-draw libreoffice-calc
6
  • I think apt-get purge triggers the error anyway, since apt-get runs on the top of dpkg. I'm trying to remove packages manually, forcing by sudo dpkg --force-all -P to purge. And it seems works. Wait a moment to know.
    – knh190
    Mar 22, 2015 at 16:22
  • @knh190 well then, why don't you give it a try and thank me afterwards :)
    – mchid
    Mar 22, 2015 at 16:25
  • Yeah, it purges the packages clean but cannot install them correctly. apt-get reports poor information to know what's going wrong.
    – knh190
    Mar 22, 2015 at 16:32
  • @knh190 please post the error from sudo apt-get install
    – mchid
    Mar 22, 2015 at 16:33
  • 1
    I made up the information.
    – knh190
    Mar 22, 2015 at 16:40
0

Thanks @mchid first, for trying to help. However in this case I have to remove openoffice clean, and sadly it's broken therefore there is no way to purge it in a normal way.

How to make this work? Fix the broken package first. So:

  • Step 1. check if any packages broken.

    sudo dpkg -l | grep openoffice # check if any packages remained, and what are they
    sudo dpkg -l | grep libreoffice
    

Since I did have unclear package remove, I have to purge it:

  • Step 2. prepare to install.

    sudo apt-get purge openoffice* libreoffice*
    

Repeat step 1 and 2 until dpkg -l | grep office command reports nothing more. Then there should be clean.

  • Step 3. install again.

We can move up to fix openoffice, (cannot be purged by step 1 and 2) following: official guide to install openoffice on linux and there're lots of instructions on internet too.

  • Step 4. purge it clean.

Once we are done, run: sudo apt-get -f install. There shouldn't be any problem. And we can remove the package again, since we now have apt-get working normally:

sudo apt-get purge openoffice*
sudo dpkg -l | grep openoffice # shouldn't report anything, since we cleanly removed it
  • Step 5. install libreoffice.

and we can install libreoffice again:

sudo apt-get install libreoffice

Finally my libreoffice worked.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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