0

I tried to follow the various instructions for installing libpng12.so which eventually led me to do the use the following command after downloading the deb file:

sudo gdebi  libpng12-0_1.2.54-1ubuntu1.1_amd64.deb

But, unfortunately, the installation of the deb leads to the errors below:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Reading state information... Done

PNG library - runtime libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files. . This package contains the runtime library files needed to run software using libpng. Do you want to install the software package? [y/N]:y /usr/bin/gdebi:113: FutureWarning: Possible nested set at position 1 c = findall("[(/\S+[])]", msg)[0].lower() (Reading database ... 373964 files and directories currently installed.) Preparing to unpack libpng12-0_1.2.54-1ubuntu1.1_amd64.deb ... Unpacking libpng12-0:amd64 (1.2.54-1ubuntu1.1) ... dpkg: error processing archive libpng12-0_1.2.54-1ubuntu1.1_amd64.deb (--install): unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such file or directory Processing triggers for libc-bin (2.35-0ubuntu3) ... Errors were encountered while processing: libpng12-0_1.2.54-1ubuntu1.1_amd64.deb

Does anyone know why I get these errors? Thanks a lot.

  • 1
    Can I confirm the version of Ubuntu you're using? It's 22.10 rather than 21.10? – matigo May 19 '22 at 04:37
  • Ubuntu 22.10 doesn't yet exist; it's currently the development release Ubuntu kinetic and remains that until it reaches RC state which isn't expected until after 13 October2022, and isn't on-topic here until release on 20 October 2022. https://discourse.ubuntu.com/t/kinetic-kudu-release-schedule/27263 Please refer https://askubuntu.com/help/on-topic. For support issues with Ubuntu kinetic you'll need to use a #ubuntu-next or #ubuntu+1 site (IRC, UF etc) – guiverc May 19 '22 at 05:14
  • package in paste matches kinetic & not impish - libc-bin | 2.35-0ubuntu3 | kinetic | amd64, arm64, armhf, i386, ppc64el, riscv64, s390x cf. libc-bin | 2.34-0ubuntu3.2 | impish-updates... – guiverc May 19 '22 at 05:17
  • I'm sorry to all. I am currently running 22.04. I will modify the title. My sincere apologies. – mark leeds May 19 '22 at 14:02

1 Answers1

0

This answer is for R users on Ubuntu 22.04 who get the error described in my question when trying to load the latticeExtra package during an R session on Ubuntu 22.04. The three steps I did were the following. (This was after a lot of googling and many dead ends !!!!! ).

Note that a lot of this answer was obtained using the instructions from user1335274 at the link below. I'm just writing them out step by step.

error while loading shared libraries: libpng12.so.0

STEP 1):

I went to ubuntuupdates.org and downloaded libpng12-0_1.2.54-1ubuntu1_amd64.deb

Then I extracted the files from the deb using ar x libpng12-0_1.2.54-1ubuntu1_amd64.deb

This resulted in two files being in my directory called data.tar.xz and control.tar.xz

STEP 2):

I didn't use the control.tar.xz because it was not needed. I obtained the files from data.tar.xz using

tar xvf data.tar.xz.

This downloaded the whole file structure that existed in the xz file. I then copied the two files below into my /usr/local/lib directory. I wasn't sure what the best place was to put them but this seemed reasonable since it wasn't crowded with a lot of other files.

/lib/x86_64-linux-gnu/libpng12.so.0.54.0

/lib/x86_64-linux-gnu/libpng12.so.0

STEP 3):

So, once I had the files above in my usr/local/lib, I then needed to modify my LD_LIBRARY_PATH in my dot bashrc file so that it included the usr/local/lib directory when paths were looked for.

I did this by putting

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

inside my dot bashrc file.

Once I did the above, I no longer had a problem when trying to install the latticeExtra package from R when running Ubuntu 22.04. I hope that this helps future R users using Ubuntu 22.04.

NB: Note that often a solution to this kind of problem is to just re-install the respective R package on the new version of Ubuntu. Unfortunately, this was not the case for latticeExtra.

  • So I have done what you describe, but now I ended up with error while loading shared libraries: libpng12.so.0: wrong ELF class: ELFCLASS64 – Vitas Oct 25 '22 at 19:01
  • Vitas: I'm sorry but I don't know that means. hopefully someone else does. I have a bash script that updates to the latest R seamlessly, atleast so far. I've been using it I think for the past 3 or 4 R updates. If you want it, email me at myname2 at gmail and I'll send it to you and explain how to run it. I can't guarantee that it will get around your current problem but it might be worth an attempt if no one here explains your current error. There are a lot of really knowledgeable on this list so I have a feeling you'll get a useful response. – mark leeds Oct 26 '22 at 07:19
  • I ran into this problem and ended up installing the prebuilt .deb binaries for these packages from cran. – mikemtnbikes Oct 28 '22 at 18:59
  • I have downloaded the right 32bit version from ubuntuupdates.org and got past that error. Unfortunately then there was a bunch of other various library errors and I fixeed them by installing :i386 versions of it, but finally I ended on libXrandr.so.2 error and that I can't seem to fix – Vitas Nov 01 '22 at 13:03