Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 4390  / 2 Years ago, sun, may 22, 2022, 12:10:58

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).


More From » apt

 Answers
4

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.


[#20827] Monday, May 23, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skipu

Total Points: 366
Total Questions: 114
Total Answers: 112

Location: Saudi Arabia
Member since Mon, Sep 5, 2022
2 Years ago
;