Ubuntu – How to install wps-office on ubuntu 17.10?

17.10

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$

Best Answer

The error mentions that wps requires libpng12-0, a package that is not installable in your machine. There are Ubuntu packages for libpng12-0 for trusty (14.04LTS) and xenial (16.04LTS), but not for 17.10. You must ask to the software manufacturer (i.e. WPS) to update the program and/or the installer to use the most recent libpng16-16.

Tools such as aptitude can find a solution, for instance, to downgrade the library, only if you have repositories configured in the /etc/apt/sources.list with the old versions.


As a workaround, you may try to download and install the .deb package for Xenial from the Ubuntu web page before installing wps.

  1. Installing 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. Installing 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. Running wps (in a X or Desktop)

    $ wps 
    

NOTE: Installing packages from older distributions may break your apt installation system.


Is it safe to install the libpng12 package from Xenial (16.04LTS) ?

Using packages from older distributions can be dangerous. It may break the apt installation system because older packages may introduce dependencies to non-existing packages or replace packages that the new versions require. Try to use packages and repositories for the Ubuntu version you are using, i.e., the official Ubuntu repositories and well-known PPA repositories (that test their packages).

To check if the installation of libpng12 can break the apt, I checked the package information.

  • The libpng12 depends on libc6 (>= 2.14) and zlib1g (>= 1:1.1.4) that are included in the recent Ubuntu versions.

    $ apt-cache policy libc6     # gives me 2.24-9ubuntu2.2
    $ apt-cache policy zlib1g    # gives me 1.2.11dfsg-0ubuntu1
    
  • Note that no other Ubuntu package requires a recent version of libpng12 because it is not included in the repository. The most recent programs depends on libpng16-16 and both libraries can coexist.

  • I think that it is very unlikely that this package breaks the apt.

Do not try to install a package of an older distribution if you are not sure of what you are doing.

Related Question