4

So basically, I run ubuntu 14.04 and I can't install packages. I ran

sudo apt-get -f install

and the terminal gave me this

the-administrator@Tower-Of-Power:~$ sudo apt-get -f install
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:
  libcdr-0.0-0 libcmis-0.4-4 libmspub-0.0-0 liborcus-0.6-0 libvisio-0.0-0
libwps-0.2-2
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libreoffice-common
Suggested packages:
  libreoffice-style-breeze libreoffice-style-crystal
  libreoffice-style-hicontrast libreoffice-style-oxygen libreoffice-style-sifr
  libreoffice-style-tango
The following NEW packages will be installed:
 libreoffice-common
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
18 not fully installed or removed.
Need to get 0 B/22.0 MB of archives.
After this operation, 82.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 284027 files and directories currently installed.)
Preparing to unpack .../libreoffice-common_1%3a4.4.2~rc2-0ubuntu1~trusty1_all.deb ...
Unpacking libreoffice-common (1:4.4.2~rc2-0ubuntu1~trusty1) ...
dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_1%3a4.4.2~rc2-0ubuntu1~trusty1_all.deb (--unpack):
trying to overwrite '/usr/bin/soffice', which is also in package openoffice-debian-menus 4.1.1-9775
rmdir: failed to remove ‘/var/lib/libreoffice/share/prereg/’: No such file or directory
rmdir: failed to remove ‘/var/lib/libreoffice/share/’: No such file or directory
rmdir: failed to remove ‘/var/lib/libreoffice/program/’: No such file or directory
rmdir: failed to remove ‘/var/lib/libreoffice’: No such file or directory
rmdir: failed to remove ‘/var/lib/libreoffice’: No such file or directory
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for gnome-icon-theme (3.10.0-0ubuntu2) ...
Processing triggers for hicolor-icon-theme (0.13-1) ...
Processing triggers for gnome-menus (3.10.1-0ubuntu2) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu1) ...
Processing triggers for mime-support (3.54ubuntu1.1) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libreoffice-common_1%3a4.4.2~rc2-0ubuntu1~trusty1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any advice?

  • Try the commands sudo apt-get autoremove, sudo apt-get clean and then rename the directory in the error message (instead of deleting, in case we should better restore it) with sudo mv /var/lib/libreoffice/ /var/lib/libreoffice-backup. After that, try sudo apt-get install -f again. If any errors occur or it doesn't help, please post the necessary outputs as edit to your question. You should also run sudo apt-get update and sudo apt-get upgrade sooner or later... – Byte Commander Apr 09 '15 at 02:03

4 Answers4

3

I'm running 16.04 and I accidentally powered down my machine while installing LibreOffice giving me the same problem. After reading this post and the one here: How force remove when post-installation script always fail I used these:

sudo dpkg --purge --force-all openoffice-debian-menus
sudo dpkg --purge --force-all libreoffice-core
sudo apt-get install -f

And it worked.

Larry S.
  • 121
1

Try the following commands

sudo apt-get autoremove
sudo apt-get clean

You could also try

 sudo dpkg --configure -a

If this works then you can perform an update using

sudo apt-get upgrade --fix-missing

I think these commands will solve your problem. if not solved post your output here.

Kolappan N
  • 767
  • 11
  • 25
0

Open Terminal and fire these commands...

sudo apt-get remove --purge libreoffice-core libreoffice-common python3-uno libreoffice-*
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
Pilot6
  • 90,100
  • 91
  • 213
  • 324
Nazar
  • 1,081
0

See this error:

Unpacking libreoffice-common (1:4.4.2~rc2-0ubuntu1~trusty1) ...
dpkg: error processing archive /var/cache/apt/archives/libreoffice-common_1%3a4.4.2~rc2-0ubuntu1~trusty1_all.deb (--unpack):
trying to overwrite '/usr/bin/soffice', which is also in package openoffice-debian-menus 4.1.1-9775

The only thing you have to do, this package should be removed.

sudo apt-get remove openoffice-debian-menus

A more comfortable way is aptitude:

sudo apt-get install aptitude
sudo aptitide purge openoffice-debian-menus

There is no need to remove the entire office. Apart from the fact that then the offending package is still installed.

And than again:

sudo apt-get -f install
A.B.
  • 90,397