如何在 ubuntu 17.10 上安装 wps-office?

如何在 ubuntu 17.10 上安装 wps-office?
android@android:~/Downloads$ sudo dpkg -i wps-office_10.1.0.5707_a21_amd64.deb
[sudo] password for android: 
Selecting previously unselected package wps-office.
(Reading database ... 134330 files and directories currently installed.)
Preparing to unpack wps-office_10.1.0.5707_a21_amd64.deb ...
Unpacking wps-office (10.1.0.5707~a21) ...
dpkg: dependency problems prevent configuration of wps-office:
 wps-office depends on libpng12-0; however:
  Package libpng12-0 is not installed.

dpkg: error processing package wps-office (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.13.3-6ubuntu5) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for shared-mime-info (1.8-1) ...
Processing triggers for hicolor-icon-theme (0.17-1) ...
Errors were encountered while processing:
 wps-office
android@android:~/Downloads$ sudo apt install libpng16-16
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libpng16-16 is already the newest version (1.6.34-1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 wps-office : Depends: libpng12-0 but it is not installable
              Recommends: ttf-mscorefonts-installer but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
android@android:~/Downloads$ sudo apt install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  wps-office
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 386 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 136822 files and directories currently installed.)
Removing wps-office (10.1.0.5707~a21) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3) ...
Processing triggers for shared-mime-info (1.8-1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu5) ...
Processing triggers for hicolor-icon-theme (0.17-1) ...
android@android:~/Downloads$ sudo apt install libpng16-16
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libpng16-16 is already the newest version (1.6.34-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
android@android:~/Downloads$ apt search libpng12-0
Sorting... Done
Full Text Search... Done
android@android:~/Downloads$

答案1

错误提示wps需要libpng12-0,但您的机器无法安装该软件包。Ubuntu 软件包libpng12-0适用于 trusty (14.04LTS) 和 xenial (16.04LTS),但不适用于 17.10。您必须要求软件制造商(即 WPS)更新程序和/或安装程序以使用最新的libpng16-16

例如,仅当您在旧版本中配置了存储库时,诸如此类的工具aptitude才可以找到解决方案来降级库。/etc/apt/sources.list


作为一种解决方法,您可以尝试下载并安装.debXenial 的软件包从 Ubuntu 网页在安装wps之前。

  1. 安装libpng12

    $ wget http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
    $ sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb
    
  2. 安装wps

    $ wget http://kdl1.cache.wps.com/ksodl/download/linux/a21//wps-office_10.1.0.5707~a21_amd64.deb
    $ sudo dpkg -i wps-office_10.1.0.5707~a21_amd64.deb
    
  3. 运行wps(在 X 或桌面上)

    $ wps 
    

笔记:安装旧发行版的软件包可能会破坏您的apt安装系统。


libpng12从 Xenial (16.04LTS)安装软件包安全吗?

使用旧发行版的软件包可能很危险。它可能会破坏apt安装系统,因为旧软件包可能会引入对不存在的软件包的依赖关系或替换新版本所需的软件包。尝试使用您正在使用的 Ubuntu 版本的软件包和存储库,即官方 Ubuntu 存储库和知名的 PPA 存储库(测试其软件包)。

为了检查安装是否libpng12会破坏apt,我检查了包裹信息

  • 依赖libpng12libc6 (>= 2.14)zlib1g (>= 1:1.1.4)包含在最新的 Ubuntu 版本中。

    $ apt-cache policy libc6     # gives me 2.24-9ubuntu2.2
    $ apt-cache policy zlib1g    # gives me 1.2.11dfsg-0ubuntu1
    
  • 请注意,没有其他 Ubuntu 软件包需要最新版本,libpng12因为它未包含在存储库中。最新的程序依赖于 libpng16-16并且两个库可以共存。

  • 我认为这个包破坏的可能性很小apt

如果您不确定自己在做什么,请不要尝试安装旧发行版的软件包。

相关内容