Categories
Linux Ubuntu

gimp: error while loading shared libraries: libgegl-0.0.so.0: cannot open shared object file: No such file or directory

After upgrading from Ubuntu 11.10 to 12.04 I found gimp couldn’t access the shared libraries it needed, most likely an error with symbolic links as described by lovelyindia in this post.

Fix 1:

He managed to fix the issue by removing gimp and purging the offending libraries and then letting apt deal with the libraries when he re-installed gimp, as per the below commands:

sudo apt-get update 
sudo apt-get purge gimp libgegl* libbabl* 
sudo apt-get install gimp 
sudo apt-get clean

While this is likely to work for most people encountering this issue, it didn’t for me.

Fix 2:

Then I remembered I had used the repogen source list generator, in which I chose to include the gimp svn build. While you may not have gone about it the same way, you may also have a different repository in your sources.list file which is causing this issue, if the previous method did not resolve the issue.

In order to fix this, I had to open the sources.list file and comment out the offending repo.

sudo gedit /etc/apt/sources.list

Now search for any reference to gimp, in my case this was the lines I changed:

#### Gimp SVN - https://launchpad.net/~matthaeus123/+archive/mrw-gimp-svn
## Run this command: sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 405A15CB
deb http://ppa.launchpad.net/matthaeus123/mrw-gimp-svn/ubuntu precise main

I commented out the line linking to the repo by adding a ‘#’ to the front, as below:

#### Gimp SVN - https://launchpad.net/~matthaeus123/+archive/mrw-gimp-svn
## Run this command: sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 405A15CB
# deb http://ppa.launchpad.net/matthaeus123/mrw-gimp-svn/ubuntu precise main

I then uninstalled gimp, once I knew it may have been the newly added repository that I had added:

sudo apt-get purge gimp

Then I saved and exited the file and updated apt:

sudo apt-get update

I then re-installed gimp:

sudo apt-get install gimp

This solved the issue for me, I hope this helps!

Categories
HowTo Posts Ubuntu

Howto fix: “error while loading shared libraries”

While installing opencv on an older version of debian for work I kept getting an error while loading shared libraries which turned out to be a pretty easy fix, just finding the libraries and adding them to the dynamic linker.

The libraries I was having trouble with below:
./blobtrack: error while loading shared libraries: libcxcore.so.1: cannot open shared object file: No such file or directory

ffmpeg
ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory

I used the ‘locate’ command to find where the libraries were eg:
locate libcxcore.so.1
This outputted a few locations of where the library was, I decided to use the /usr/local/lib version as both libraries I needed were in there and did the following command to add them to ld.so.conf and reload the dynamic linker:
sh -c 'echo "/usr/local/lib" >> /etc/ld.so.conf && ldconfig'