7

When trying to run the printer utility I downloaded from Epson website I get the following error:

epson-printer-utility: error while loading shared libraries: libQtCore.so.4: cannot open shared object file: No such file or directory

I presume this is because the QT4 libraries aren't installed on Ubuntu 20.04 LTS. And it seems no longer available to install.

I have googled and tried installing various QT4 libraries by various means without success. For example:

$ sudo apt-get install qt4-default
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package qt4-default is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'qt4-default' has no installation candidate

Help please.

I'm new to linux so be kind and very specific with what I need to do!

AEM
  • 1,166
  • 2
  • 11
  • 18
nomorewin
  • 83
  • 1
  • 1
  • 5
  • Will installing QT5 help? I thought the printer utility was looking specifically for the QT4 libraries (libQtCore.so.4)? – nomorewin Apr 30 '20 at 10:28
  • Still no joy. I installed qt5-default in desperation but epson-printer-utility still looking for libQtCore.so.4. Can anyone help me please??? – nomorewin May 01 '20 at 22:31
  • 1
    Can anyone help me with installing qt4 on 20.04 please? How do I configure Ubuntu to find the old binaries/libraries? – nomorewin May 05 '20 at 19:21

4 Answers4

10

Ubuntu 20.04 LTS no longer has Qt4 libraries on purpose. See this question, for instance. Your best bet is compiling from source, or setting up a virtual machine with an older Ubuntu version as the guest OS.

Or, if you're feeling adventurous, you can add this PPA, then install Qt4:

sudo apt-add-repository ppa:rock-core/qt4
sudo apt update
sudo apt install qt4-default

This removes qt5-default from your system. Let's add it back:

sudo apt install qt5-default

Now you have both Qt4 and Qt5 libraries installed in your system in a fragile balance. The Qt4 libraries will be removed the next time you run sudo apt autoremove to clean up installed packages. Let's prevent that from happening:

sudo apt install libodbc1 libqt4-dbus libqt4-declarative libqt4-designer libqt4-dev libqt4-dev-bin libqt4-help libqt4-network libqt4-opengl libqt4-opengl-dev libqt4-qt3support libqt4-script libqt4-scripttools libqt4-sql libqt4-sql-odbc libqt4-svg libqt4-test libqt4-xml libqt4-xmlpatterns libqtcore4 libqtdbus4 libqtgui4 qdbus qt4-linguist-tools qt4-qmake qtcore4-l10n
wyphan
  • 337
  • 6
  • 18
6

The following worked for me on Ubuntu 20.10 for epson-printer-utility_1.1.1-1lsb3.2_amd64.deb

Download the following bionic packages:
http://mirrors.kernel.org/ubuntu/pool/universe/q/qt4-x11/libqtcore4_4.8.7+dfsg-7ubuntu1_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/universe/q/qt4-x11/libqtgui4_4.8.7+dfsg-7ubuntu1_amd64.deb

Extract from them the following files:

libQtCore.so.4.8.7
libQtGui.so.4.8.7

Copy these two files to /usr/lib/x86_64-linux-gnu. Assuming that folder with the files mentioned above is current folder in terminal:

sudo cp libQtCore.so.4.8.7 /usr/lib/x86_64-linux-gnu/
sudo cp libQtGui.so.4.8.7 /usr/lib/x86_64-linux-gnu/

Make appropriate symbolic links in /usr/lib/x86_64-linux-gnu:

cd /usr/lib/x86_64-linux-gnu/
sudo ln -s libQtCore.so.4.8.7 libQtCore.so.4
sudo ln -s libQtGui.so.4.8.7 libQtGui.so.4

The above makes Epson Printer Utility up and running. But its functionality is... Well, it is disappointing. All the functions provided can be performed on the device itself.
Epson Printer Utility main window

N.B. The following message does not seem to harm the application.

Gtk-Message: Failed to load module "overlay-scrollbar"

It can be fixed by installation of overlay-scrollbar-gtk2 package:

sudo apt install overlay-scrollbar-gtk2
Alex'LP
  • 93
  • 1
  • 5
  • 3
    this solution worked for me, but I also had to download libaudio package from http://archive.ubuntu.com/ubuntu/pool/main/n/nas/libaudio2_1.9.4-6_amd64.deb and repeat the copy libaudio process to the same dir. By the way, I'm on ubuntu 21.10. – apolinux Mar 16 '22 at 14:21
1

You can download the libqt4 packages for the previous release, extract them, and tell epson-printer-utility to use them by setting LD_LIBRARY_PATH. I made a script:

https://gist.github.com/derde/025a1cdbfadc3e56dc6a46093d922c32

#! /bin/bash
  
  # Run epson-printer-utility from epson-printer-utility_1.0.2-1lsb3.2_amd64.deb
  # using downloaded libqt4 libraries from previous Ubuntu version (not provided
  # in Ubuntu 20.04 "focal fossa"
  #
  # This downloads the deb files and extracts them in a libs directory in the
  # current directory, and then runs the utility
  #
  # Fix for:
  # epson-printer-utility: error while loading shared libraries: libQtCore.so.4: cannot open shared object file: No such file or directory
  
  DEBS='
      http://mirrors.kernel.org/ubuntu/pool/universe/q/qt4-x11/libqtgui4_4.8.7+dfsg-7ubuntu3_amd64.deb
      http://mirrors.kernel.org/ubuntu/pool/universe/q/qt4-x11/libqtcore4_4.8.7+dfsg-7ubuntu3_amd64.deb
  '
  cd `dirname $0`
  mkdir -p libs
  cd libs
  
  echo "## `pwd`"
  if ! [ -f data.tar.zx ] ; then
      for DEB in $DEBS; do
          FILE="${DEB/*\/}"
          [ -f "$FILE" ] && continue
          echo "## download $DEB"
          wget $DEB
          echo "## extract $FILE"
          ar x $FILE
          tar -xJf data.tar.xz
          rm control.tar.xz  data.tar.xz debian-binary
      done
  fi
  
  echo "## run epson-printer-utility with `pwd`"
  LD_LIBRARY_PATH=`pwd`/./usr/lib/x86_64-linux-gnu epson-printer-utility
  • Thanks for this. One step forward. But another error now... epson-printer-utility: error while loading shared libraries: libaudio.so.2: cannot open shared object file: No such file or directory – nomorewin Jun 28 '20 at 22:32
  • See if you can get another copy of `epson-printer-utility_1.0.2-1lsb3.2_amd64.deb` I got one from here ... http://download.ebz.epson.net/dsc/search/01/search/searchModule It does not link to `libaudio.so.2`, as shown by `ldd /opt/epson-printer-utility/bin/epson-printer-utility` – user6031769 Jul 01 '20 at 20:42
  • 1
    I don't have enough reputation to answer to [@user6031769](https://askubuntu.com/users/1099641/user6031769), so I'll answer here. `libaudio.so.2` is required by the `libs/usr/lib/x86_64-linux-gnu/libQtGui.so.4` dowloaded by the script. I could not find answer on where to find this shared library with a quick search on the internet. – ppom Aug 09 '20 at 12:16
  • @ppom thanks for the useful comment! You can ask a new question about this if you don't get a response here - just add a link to this post in your question. – Zanna Aug 09 '20 at 12:56
1

I fixed this problem without using a PPA.

I downloaded three packages from bionic repo:

libqtcore4_4.8.7+dfsg-7ubuntu1_amd64.deb
libqtgui4_4.8.7+dfsg-7ubuntu1_amd64.deb
libaudio2_1.9.4-6_amd64.deb

and extracted these files using Archive manager:

libQtCore.so.4
libQ4Core.so.4.8.7
libQtGui.so.4
libQtGui.so.4.8.7
libaudio.so.2

then copied all 5 files to /usr/lib/x86_64-linux-gnu

Pilot6
  • 88,764
  • 91
  • 205
  • 313
  • I had to extract and copy libaudio.so.2.4 too. But on running the epson utility I get:epson-printer-utility: error while loading shared libraries: libaudio.so.2: wrong ELF class: ELFCLASS32 Any idea how to fix that please? – nomorewin Nov 25 '20 at 22:59
  • Actually the ELF class error was probably because I downloaded that archive for Ubuntu 20.04. I found libaudio2_1.9.4-6_amd64.deb for 18.04 and now I get another error: Failed to load module "canberra-gtk-module" At this rate I'm going to go back to using Windows 10. Help please! – nomorewin Nov 25 '20 at 23:49
  • You need to download all packages for 18.04. – Pilot6 Nov 26 '20 at 08:52
  • To solve this problem I only had to install libqtcore4 and libqtgui4 using sudo apt install libqtcore4 libqtgui4 – minmax Jun 02 '21 at 23:22