0

I have install libreoffice4.1 but when I try to install python-uno It had error

sudo apt-get install python-uno
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python-uno : Depends: libreoffice-core (= 1:4.0.2-0ubuntu1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I don't know how to fix this. Please help. apt-cache policy python-uno libreoffice-core

python-uno:
  Installed: (none)
  Candidate: 1:4.0.2-0ubuntu1
  Version table:
     1:4.0.2-0ubuntu1 0
        500 http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ raring/universe amd64 Packages
libreoffice-core:
  Installed: (none)
  Candidate: 1:4.0.2-0ubuntu1
  Version table:
     1:4.1.0-0ubuntu1~raring1~ppa1 0
        100 /var/lib/dpkg/status
     1:4.0.2-0ubuntu1 0
        500 http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ raring/main amd64 Packages

After add ppa for libreoffice I install but have error like this

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libreoffice-common libreoffice-core
Suggested packages:
  libreoffice-style-crystal libreoffice-style-hicontrast libreoffice-style-human libreoffice-style-oxygen libreoffice-style-tango
The following NEW packages will be installed:
  libreoffice-common libreoffice-core python-uno
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 28.5 MB/56.2 MB of archives.
After this operation, 196 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ppa.launchpad.net/libreoffice/ppa/ubuntu/ raring/main libreoffice-core amd64 1:4.1.0-0ubuntu1~raring1~ppa1 [28.2 MB]
Get:2 http://ppa.launchpad.net/libreoffice/ppa/ubuntu/ raring/main python-uno amd64 1:4.1.0-0ubuntu1~raring1~ppa1 [284 kB]                      
Fetched 28.5 MB in 1min 21s (351 kB/s)                                                                                                          
(Reading database ... 415424 files and directories currently installed.)
Unpacking libreoffice-common (from .../libreoffice-common_1%3a4.1.0-0ubuntu1~raring1~ppa1_all.deb) ...
dpkg: error processing /var/cache/apt/archives/libreoffice-common_1%3a4.1.0-0ubuntu1~raring1~ppa1_all.deb (--unpack):
 trying to overwrite '/usr/bin/soffice', which is also in package openoffice-debian-menus 4.0-9702
rmdir: failed to remove ‘/var/lib/libreoffice/share/prereg/’: No such file or directory
rmdir: failed to remove ‘/var/lib/libreoffice/share/’: Directory not empty
rmdir: failed to remove ‘/var/lib/libreoffice/program/’: No such file or directory
rmdir: failed to remove ‘/var/lib/libreoffice’: Directory not empty
rmdir: failed to remove ‘/var/lib/libreoffice’: Directory not empty
Selecting previously unselected package libreoffice-core.
Unpacking libreoffice-core (from .../libreoffice-core_1%3a4.1.0-0ubuntu1~raring1~ppa1_amd64.deb) ...
Selecting previously unselected package python-uno.
Unpacking python-uno (from .../python-uno_1%3a4.1.0-0ubuntu1~raring1~ppa1_amd64.deb) ...
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for shared-mime-info ...
Unknown media type in type 'all/all'
Unknown media type in type 'all/allfiles'
Unknown media type in type 'uri/mms'
Unknown media type in type 'uri/mmst'
Unknown media type in type 'uri/mmsu'
Unknown media type in type 'uri/pnm'
Unknown media type in type 'uri/rtspt'
Unknown media type in type 'uri/rtspu'
Processing triggers for man-db ...
Processing triggers for gnome-icon-theme ...
Processing triggers for hicolor-icon-theme ...
Errors were encountered while processing:
 /var/cache/apt/archives/libreoffice-common_1%3a4.1.0-0ubuntu1~raring1~ppa1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

if I run

sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of libreoffice-core:
 libreoffice-core depends on libreoffice-common (>> 1:4.1.0); however:
  Package libreoffice-common is not installed.

dpkg: error processing libreoffice-core (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-uno:
 python-uno depends on libreoffice-core (= 1:4.1.0-0ubuntu1~raring1~ppa1); however:
  Package libreoffice-core is not configured yet.

dpkg: error processing python-uno (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libreoffice-core
 python-uno

if I run

sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libreoffice-common
Suggested packages:
  libreoffice-style-crystal libreoffice-style-hicontrast libreoffice-style-human libreoffice-style-oxygen libreoffice-style-tango
The following NEW packages will be installed:
  libreoffice-common
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
Need to get 0 B/27.7 MB of archives.
After this operation, 76.9 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 415610 files and directories currently installed.)
Unpacking libreoffice-common (from .../libreoffice-common_1%3a4.1.0-0ubuntu1~raring1~ppa1_all.deb) ...
dpkg: error processing /var/cache/apt/archives/libreoffice-common_1%3a4.1.0-0ubuntu1~raring1~ppa1_all.deb (--unpack):
 trying to overwrite '/usr/bin/soffice', which is also in package openoffice-debian-menus 4.0-9702
rmdir: failed to remove ‘/var/lib/libreoffice/share/prereg/’: No such file or directory
rmdir: failed to remove ‘/var/lib/libreoffice/share/’: Directory not empty
rmdir: failed to remove ‘/var/lib/libreoffice/program/’: No such file or directory
rmdir: failed to remove ‘/var/lib/libreoffice’: Directory not empty
rmdir: failed to remove ‘/var/lib/libreoffice’: Directory not empty
Processing triggers for bamfdaemon ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils ...
Processing triggers for gnome-menus ...
Processing triggers for shared-mime-info ...
Unknown media type in type 'all/all'
Unknown media type in type 'all/allfiles'
Unknown media type in type 'uri/mms'
Unknown media type in type 'uri/mmst'
Unknown media type in type 'uri/mmsu'
Unknown media type in type 'uri/pnm'
Unknown media type in type 'uri/rtspt'
Unknown media type in type 'uri/rtspu'
Processing triggers for man-db ...
Processing triggers for gnome-icon-theme ...
Processing triggers for hicolor-icon-theme ...
Errors were encountered while processing:
 /var/cache/apt/archives/libreoffice-common_1%3a4.1.0-0ubuntu1~raring1~ppa1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Braiam
  • 67,791
  • 32
  • 179
  • 269
giaosudau
  • 1,949

2 Answers2

3

trying to overwrite '/usr/bin/soffice', which is also in package openoffice-debian-menus 4.0-9702

python-uno depends of libreoffice-core and libreoffice-core deppends of libreoffice-common, but libreoffice-common is not being installed due openoffice-debian-menus owning the /usr/bin/soffice binary. Is a dependency correlation problem due installing and mixing packages, where python-uno won't install while openoffice-debian-menus is installed. So, method to solve this:

sudo apt-get --fix-broken purge openoffice-debian-menus
sudo dpkg --configure -a
sudo apt-get -f install

This will delete the annoying openoffice-debian-menus package, that will allow you to install libreoffice's and sane your system.

Braiam
  • 67,791
  • 32
  • 179
  • 269
2

If you have installed the packages by manually downloading and installing them, you will get conflicts like this. Why? Because APT can only "see" the packages in repositories. You have decided to install only a certain set of packages earlier on and now that you need another, it will only see the one in the Ubuntu main repositories.

To fix this and to install LibreOffice in a way that you will receive updates, I suggest you to install the LibreOffice 4.1 PPA.

  1. Run

    sudo apt-add-repository ppa:libreoffice/libreoffice-4-1
    

    to install the 4.1 repository.

  2. Then, run

    sudo apt-get update && sudo apt-get dist-upgrade
    

    to get fully up to date.

  3. You should now be able to install the latest python-uno compatible with 4.1.

See also Is there a PPA with the latest version of LibreOffice?

gertvdijk
  • 67,947
  • I had error before doing that update above – giaosudau Aug 22 '13 at 06:16
  • @sepdau Ah man, you've installed more packages from other sites that cause conflicts... Here's openoffice-debian-menus to blame. Do you really need OpenOffice as well? – gertvdijk Aug 22 '13 at 06:18
  • I install openoffice after remove libreoffice then I install libreoffice again then I can't not remove Package You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: libreoffice-core : Depends: libreoffice-common (> 1:4.1.0) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). – giaosudau Aug 22 '13 at 06:22
  • @sepdau Well, in order to be able to tell you how to uninstall OpenOffice you'll have to tell how you've installed it in the first place. Please include that in your question. Also, what does sudo apt-get install -f do? – gertvdijk Aug 22 '13 at 06:38
  • I've update above. – giaosudau Aug 22 '13 at 06:39