python-uno:依赖:libreoffice-core(= 1:4.0.2-0ubuntu1)

python-uno:依赖:libreoffice-core(= 1:4.0.2-0ubuntu1)

我已经安装了 libreoffice4.1,但是当我尝试安装 python-uno 时出现错误

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.

我不知道如何修复这个问题。请帮忙。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

添加 libreoffice 的 ppa 后,我安装了,但出现了这样的错误

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)

如果我跑

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

如果我跑

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)

答案1

尝试覆盖 '/usr/bin/soffice',它也位于软件包 openoffice-debian-menus 4.0-9702 中

python-uno依赖libreoffice-corelibreoffice-core依赖libreoffice-common,但由于拥有二进制文件libreoffice-common而无法安装。这是由于安装和混合软件包而导致的依赖关系问题,其中不会安装而 已安装。因此,解决此问题的方法:openoffice-debian-menus/usr/bin/sofficepython-unoopenoffice-debian-menus

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

这将删除烦人的openoffice-debian-menus软件包,允许您安装 libreoffice 并使您的系统正常运作。

答案2

如果你手动下载并安装软件包,就会出现这样的冲突。为什么?因为 APT 只能“看到”存储库。您之前已决定仅安装一组特定的软件包,而现在您需要另一组软件包,它只会在 Ubuntu 主存储库中看到该软件包。

为了解决这个问题并以您将收到更新的方式安装 LibreOffice,我建议您安装 LibreOffice 4.1 PPA。

  1. 跑步

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

    安装 4.1 存储库。

  2. 然后,运行

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

    以全面了解最新情况。

  3. 您现在应该能够安装最新的python-uno与 4.1 兼容的版本。

也可以看看是否有带有最新版本 LibreOffice 的 PPA?

相关内容