# /libexec/ld-elf.so.1: Shared object "libjpeg.so.9" not found



## SeaHag (Jul 30, 2009)

I upgraded /graphics/jpeg according to UPDATING with;


```
portupgrade -fr graphics/jpeg
```


```
20090719:
  AFFECTS: users of graphics/jpeg
  AUTHOR: dinoex@FreeBSD.org

  jpeg has been updated to 7.0.
  Please rebuild all ports that depends on it.

  If you use portmaster please use:
        portmaster -r jpeg-
  If you use portupgrade please use:
        portupgrade -fr graphics/jpeg
```

Now alot of my programs fail to run with this error;


```
/libexec/ld-elf.so.1: Shared object "libjpeg.so.9" not found, required by <insert your favorite program here>
```

Now what do I do? I just got this box working now it's broke again.


----------



## jb_fvwm2 (Jul 30, 2009)

see the july 24 -- july 25 thread
"gd seems to be broken" 
for fixes.


----------



## DutchDaemon (Jul 30, 2009)

Yes, search the forums. Searching for 'libjpeg.so.9' gives you four other threads about this.


----------



## SeaHag (Jul 30, 2009)

> see the july 24 -- july 25 thread
> "gd seems to be broken"
> for fixes.



Didn't work. It says;



> Do a pkg_delete -f on the gd package, go to /usr/ports/graphics/gd, do make clean && make distclean(probably not needed, but its what I always do), and a make install clean.




I did that and make install clean still says it can't find "libjpeg.so.9".



> Yes, search the forums. Searching for 'libjpeg.so.9' gives you four other threads about this.



Yes, I already saw those, there's no solution. I've done portmaster -dRrf jpeg-7. The jist of all these posts seems to be uninstall and reinstall every thing that depends on jpeg but I can't get things to install.


----------



## MG (Jul 31, 2009)

maybe there's a newer version in /usr/local/lib.

ln -s /usr/local/lib/libjpeg.so.10 /usr/local/lib/libjpeg.so.9


----------



## SeaHag (Jul 31, 2009)

> maybe there's a newer version in /usr/local/lib.
> 
> ln -s /usr/local/lib/libjpeg.so.10 /usr/local/lib/libjpeg.so.9



Yes there's a libjpeg.so.10. So what are you saying I should link to it? Is this just a bandaid fix that's going to cause other problems down the road? Why doesn't it work the way it's supposed to? I also tried;


```
portupgrade -fr jpeg
```

It ran for a long time like it was reinstalling everything but things still don't run. Amarok, konqueror, opera...
When I try to install amarok after deinstall i get;


```
"libjpeg.so.9" not found
```

opera;

```
usr/local/share/opera/ini/pluginpath.ini FAILED md5 check: c5b66b8c5ce9f14bdd7b6a5c34f456a8 != ee5c425fba376571c6ef81631e9623b5
```


This system is all screwed up now. How do I fix it?


----------



## MG (Jul 31, 2009)

Just link libjpeg.9 to the  existing libjpeg.10 in the same directory.

Don't know about Opera. Try removing its default config directory to make it think it starts for the first time. Or make reinstall / make clean reinstall

If it became a complete mess, try to save any customized config file on your system, do a "pkg_delete -a" an install all apps you need with pkg_add -r


----------



## SeaHag (Jul 31, 2009)

> Just link libjpeg.9 to the existing libjpeg.10 in the same directory.



Sure, I can just blindly do what people say but I'd like to know what I'm doing. Why didn't the other methods work? I ran portupgrade and portmaster but still things are looking for libjpeg.9.



> If it became a complete mess, try to save any customized config file on your system, do a "pkg_delete -a" an install all apps you need with pkg_add -r



I do make deinstall and make install clean, isn't that good enough? I prefer that to packages but it's always looking for libjpeg.9.


----------



## MG (Jul 31, 2009)

SeaHag said:
			
		

> Sure, I can just blindly do what people say but I'd like to know what I'm doing. Why didn't the other methods work? I ran portupgrade and portmaster but still things are looking for libjpeg.9.



You can at least try if it works.

Looks like you got in dependency hell by using tools like portupgrade too impulsive, especially with those -fr parameters. Last solutions are try a correct updating of your portsdb and pkgdb, an rebuild the apps that lost any dependencies or manually trace back the version numbers using the FreeBSD ports index site. But that's too much to explain without docs.


----------



## SeaHag (Jul 31, 2009)

The symlink is allowing amarok to install but I'm afraid programs looking for libjpeg.9 will get libjpeg.10 and have problems. Is that the case? 

After amarok was done installing I ran it and got;


> Bus error (core dumped)



Oh the joy of FreeBSD.


----------



## MG (Jul 31, 2009)

"jpeg" is a default package in many *NIX systems and probably fully downward compatible.

It would be different if you linked a .10 to a .9 library
There might be new features in other packages that are not yet supported. But it can still be worth trying.


----------



## SeaHag (Jul 31, 2009)

> Looks like you got in dependency hell by using tools like portupgrade too impulsive, especially with those -fr parameters.



The /usr/ports/UPDATING file said to. I'd like to know why after doing this when I run or install opera it says "libjpeg.so.9"not found. Same with konqueror, amarok...


----------



## MG (Jul 31, 2009)

with ldd you can list the needed library versions of any program.
If there are newer versions installed, a symlink usually does the job.

Apparently your Opera-version requires an older library that has somehow disappeared. You can try fixing al the version mismatches on your system, but it's easier to pkg_delete and reinstall everything so that the correct dependencies are fetched and built.


----------



## SeaHag (Jul 31, 2009)

```
ldd opera
ldd: opera: No such file or directory
```

Can't I just do a pkg_delete on one package and see if it works first before destroying my system even further? If i do pkg_delete opera it says not installed. If I try to install it it says libjpeg.9 not found. Everything I try to install says libjpeg.9 not found. Isn't it supposed to fixed by running portupgrade -fr graphics/jpeg? That command ran for a long time and afterwards things still don't work.


----------



## SeaHag (Jul 31, 2009)

Form /usr/ports/UPDATING;

```
20090719:
  AFFECTS: users of graphics/jpeg
  AUTHOR: dinoex@FreeBSD.org

  jpeg has been updated to 7.0.
  Please rebuild all ports that depends on it.

  If you use portmaster please use:
        portmaster -r jpeg-
  If you use portupgrade please use:
        portupgrade -fr graphics/jpeg
```

When I try I get;

```
# portmaster -r jpeg-

===>>> No valid installed port, or port directory given
===>>> Try portmaster --help
```

So I try portmaster -r jpeg-7, it runs for a while then and get;

```
===>>> Port directory: /usr/ports/emulators/linux_base-f10
	===>>> This port is marked IGNORE
	===>>> compat.linux.osrelease: 2.4.2 is not supported, please use 2.6.16

	===>>> If you are sure you can build it, remove the
	       IGNORE line in the Makefile and try again.

===>>> Update for /usr/ports/emulators/linux_base-f10 failed
===>>> Aborting update

===>>> Update for nspluginwrapper-1.2.2_2 failed
===>>> Aborting update

Terminated
Terminated
Terminated
Terminated
Terminated
Terminated
Terminated
Terminated
```


----------



## MG (Jul 31, 2009)

SeaHag said:
			
		

> ```
> ldd opera
> ldd: opera: No such file or directory
> ```
> ...



use ldd with the full pathname
use pkg_delete with full package name including version number or use wildcards (jpeg*)

And all your software is depending on an earlier version of jpeg, probably jpeg 6b_7. The upgrade proces on jpeg did not relink the library correctly to the installed software. You can try downgrade jpeg, but probably you also have software installed which is already upgraded to use the newer version.

Just take the programs you want to use and look at their dependencies with ldd for binaries deps and pkg_info -r for package deps. Then upgrade or downgrade whatever is needed.

By the way, did you Google for compat.linux.osrelease?


----------



## SeaHag (Jul 31, 2009)

```
# ldd /usr/ports/audio/amarok
ldd: /usr/ports/audio/amarok: not a dynamic executable
# ldd /usr/ports/www/opera
ldd: /usr/ports/www/opera: not a dynamic executable
```



> And all your software is depending on an earlier version of jpeg, probably jpeg 6b_7.



Why? Isn't the /usr/ports/UPGRADE instructions supposed to fix that?



> The upgrade proces on jpeg did not relink the library correctly to the installed software.



Ya, apparently.



> Just take the programs you want to use and look at their dependencies with ldd for binaries deps and pkg_info -r for package deps. Then upgrade or downgrade whatever is needed.



How? What do you mean by "upgrade"? I can't upgrade anything, I do make deinstall or pkg_delete then make install clean and it always tells me libjpeg.so.9 not found. I ran;


```
portupgrade -fr jpeg-7
/[code]

It ran for a long time recompiling lots of stuff and now opera works but still no amarok or konqueror
```


----------



## DutchDaemon (Jul 31, 2009)

Running ldd on a port won't work  You'll have to run it against the executable:


```
ldd `which amarok`
ldd `which opera`
```


----------



## SirDice (Jul 31, 2009)

MG said:
			
		

> maybe there's a newer version in /usr/local/lib.
> 
> ln -s /usr/local/lib/libjpeg.so.10 /usr/local/lib/libjpeg.so.9



Just a note, you should NOT do this. Doing this can seriously bite you some day.

Try and resolve the dependencies. Your best bet is to rebuild all the ports that are complaining about the missing libjpeg.so.9.


----------



## SeaHag (Jul 31, 2009)

```
#whereis opera
opera: /usr/local/bin/opera
# ldd /usr/local/bin/opera
ldd: /usr/local/bin/opera: not a dynamic executable
```

amarok is no longer installed. I did make deinstall and now it won't install failing for libjpeg.so.9 not found. And I can't find konqueror. I don't remember how I installed it.




> Originally Posted by MG View Post
> maybe there's a newer version in /usr/local/lib.
> 
> ln -s /usr/local/lib/libjpeg.so.10 /usr/local/lib/libjpeg.so.9
> Just a note, you should NOT do this. Doing this can seriously bite you some day.



Ya, that's what i thought. I'm trying to avoid doing that. I can't rebuild the ports, they always fail for libjpeg.so.9 not found. What do you mean by "rebuild the port"? you mean by running make install clean after make deinstall or pkg_delete?


----------



## SirDice (Jul 31, 2009)

SeaHag said:
			
		

> I can't rebuild the ports, they always fail for libjpeg.so.9 not found.


This might be due to a dependency of that port still being linked to libjpeg.so.9.

Since it happens during build try doing a *make build-depends-list* in the port's directory. Have a look at each one if they might still be linked to the old version.


----------



## DutchDaemon (Jul 31, 2009)

As long as your entire portupgrade/portmaster-upgrade for jpeg doesn't complete, you will be facing errors. First fix this:

[cmd=]sysctl compat.linux.osrelease=2.6.16[/cmd]
[cmd=]echo compat.linux.osrelease=2.6.16 >> /etc/sysctl.conf[/cmd]

Then run the recursive upgrade for jpeg again. Repair every mistake along the way until the run has finished completely. Only then tackle indvidual ports that still want libjpeg.so.9, or upgrade all ports showing up in [cmd=]pkg_info -R jpeg-7[/cmd].

Oh, and choose: use portupgrade or portmaster, not both! Using them together may lead to inconsistencies in the other's internal administration. When you use portmaster, portupgrade's databases will not register/reflect any changes made by portmaster. It's possible that that's what's keeping these libjpeg errors around.


----------



## SeaHag (Jul 31, 2009)

> As long as your entire portupgrade/portmaster-upgrade for jpeg doesn't complete, you will be facing errors. First fix this:
> 
> sysctl compat.linux.osrelease=2.6.16
> echo compat.linux.osrelease=2.6.16 >> /etc/sysctl.conf
> ...



Ya, that's probably what's causing the problems. Something else is installing right now then I'll try that. This seems obvious but I'll ask anyway, can you install more than one port at a time? I think no so I'll wait till the other is done.


----------



## DutchDaemon (Jul 31, 2009)

Parallel installs are not advisable, unless you are dead certain that they won't be working on the same dependencies at the same time (race condition), clobbering the compilation of that dependency and nuking both ports.


----------



## DutchDaemon (Jul 31, 2009)

P.S.: I added something to the post you replied to. Please make sure you read that last paragraph!

http://forums.freebsd.org/showpost.php?p=34598&postcount=22


----------



## jb_fvwm2 (Jul 31, 2009)

rebuild (pkg_delete -f /var/db/pkg/imlib[1 or 2 or both] ) both imlib
rebuild xli
rebuild lib* that had versions bumped
rebuild jasper if installed
grep  libjpeg /usr/local/bin | hgrep Binary
...
(more complete instructions in another post or two recently
probably.) The instructions above are just a rough draft, but
may save you time if you know how to rebuild individual ports
in parallel, etc.  (You should probably learn that also for
the next time the UPDATING do not do a complete upgrade for
a particular machine)


----------



## MG (Jul 31, 2009)

SirDice said:
			
		

> Just a note, you should NOT do this. Doing this can seriously bite you some day.
> 
> Try and resolve the dependencies. Your best bet is to rebuild all the ports that are complaining about the missing libjpeg.so.9.



Why not? I do this for years. and never had any trouble with it. In case something doesnt work, I can always remove the symlinks, but I never needed to, never seen any program complaining about using a library newer than the version it depends on.

Otherwise it would not be possible to play with the latest software without having to upgrade everything to -CURRENT or learn to use chroot/jails/emulation/multiboot to do your testing. 

Just let's not make it too difficult for new users.
In my opinion it's a serious waste of time to rebuild and reinstall everything just because some libs have newer versions installed.


----------



## DutchDaemon (Aug 1, 2009)

The latest portsnap run gave me 3000+ patches compared to the one of twelve hours ago. Looks like it concerns a lot of ports with jpeg dependencies, so this might be the 'bump all' moment for libjpeg.so.10. I guess people having trouble with libjpeg should update their ports and then repeat the actions mentioned in /usr/ports/UPDATING. Sorry for spamming this to six threads, but it seemed rather important with all the confusion out there


----------



## hy0kl (Aug 1, 2009)

Try this:
# /usr/local/lib
# ln -s libjpeg.so.10 libjpeg.so.9


----------



## SeaHag (Aug 1, 2009)

*24 hours rebuilding and I'm back on the road.*

Wow I think I got mine working. It took about 24 hours using portmaster -Rr jpeg-7. It ran for about 3 hrs. then failed for /usr/ports/graphics/gd Error 1. I installed the port manually and restarted. About 5 hrs. later failed for /usr/ports/www/firefox3. Again, manual install and restart. Then it ran for a long time, 6-8 hours and failed for x11/kdelibs3. Install, restart now almost 24 hours later things seem to be working correctly. Thanks for all the help everyone.


----------



## MG (Aug 1, 2009)

DutchDaemon said:
			
		

> Parallel installs are not advisable, unless you are dead certain that they won't be working on the same dependencies at the same time (race condition), clobbering the compilation of that dependency and nuking both ports.



I thougt there was some sort of locking system on it. Never had any message from it, though.
But some ports cannot live together so it's still dangerous.


----------



## jb_fvwm2 (Aug 1, 2009)

I often build/reinstall 4 ports at a time, seldom a
problem.
tty0

```
make run-depends-list
```
tty1 
make ...
tty2 
make ...
tty3 
make ...
then
each:  
	
	



```
make build && yell
```
(actually more complex than that, for quicker/smoother
completion, I've scripted most of it)
a few /yells/ and I can return to the builds from browsing or...


----------



## smkstack (Sep 18, 2009)

I hit exactly the same problem, but took a slightly different approach.

Since I was running the 7.0-Release I ftp'd to ftp3.us.freebsd.org, found my version, went into its ports/graphics directory and downloaded jpeg-6b_4.tgz.

On my machine I unpacked it and copied it to /usr/local/lib. Just be sure to delete the soft link if you made one according to the ealier posts. So far everything is working fine.


----------



## unAmygdala (Oct 10, 2009)

I would like some more clarity on why doing the following command is a bad idea:

ln -s /usr/local/lib/libjpeg.so.10 /usr/local/lib/libjpeg.so.9

It seems like its the only real solution provided, aside from rebuilding all affected ports.


----------



## Carpetsmoker (Oct 10, 2009)

The libjpeg people have decided that this version is not compatible with the previous version, so they bumped the shared library version number.

This *may* mean that just one almost unused function call has changed. It *may* also mean a lot of important function calls have changed.

You can make the link and if it works then it works and if it doesn't work then it doesn't. It may work today, it may not work tomorrow. Some functions may not work, the program may be unstable. It is difficult to tell.
But in any case, there is *probably* little chance of serious harm but there are no seatbelt or support. Use at own risk.

Me personally, I would just install both the new and old jpeg ports at the same time (Some minor hacking required).



			
				MG said:
			
		

> I thougt there was some sort of locking system on it. Never had any message from it, though.
> But some ports cannot live together so it's still dangerous.



OpenBSD ports do locking, and you can safely build any number of ports at the same time.
FreeBSD doesn't do any locking.


----------



## jgh@ (Nov 21, 2009)

I would recommend using libmap.conf or ** rebuild ports that fail ** 

This way they would compile against the updated library


----------



## raul_comodoro (Jun 25, 2011)

*A possibility to deal with linjpeg.so.10 when it is disappeared from the system*

A few days ago I was installing VLC media player, and after that KDE did not work anyway, the problem was that libjpeg.so.10 disappeared from /usr/local/lib; KDE could not start up.

Reading the posts related with this issue I found several solutions to fix it, and working around, in example making a symbolic link as is stated in several posts solved the problem but not completely. Then I took another way to solve the problem. I've installed the system from the beginning in a virtualized folder, then copied libjpeg.so.10 and libogg.so.6 to a safe place outside this folder and copied again these libraries to my original damaged system. I made a copy of theses libraries in a safe place in my original system too, as a backup from restoring them again if something wrong happens in future again.

I have tested KDE and everything was OK. I have deleted my virtualized system, and that was all the work. I feel this is a possibility if you have a way to work around by using some virtualizing software.


----------



## raul_comodoro (Jul 4, 2011)

As stated below....on the post of MG:

Maybe there's a newer version in /usr/local/lib.

`ln -s /usr/local/lib/libjpeg.so.10 /usr/local/lib/libjpeg.so.9`

This is applicable in a general way. And works fine.

I had a problem with Amarok and Aqualung, the same you write on here. But it was with libmodplug.so.0.

In my /usr/local/lib appeared libmodplug.so, so I made a symbolic link.

`ln -s /usr/local/lib/libmodplug.so.0 /usr/local/lib/libmodplug.so.0`

Everything is working fine now. Amarok and Aqualung play mp3 perfectly.


----------



## fmw (Jul 11, 2011)

So far, I've been able to straighten these things out by updating or rebuilding the programs or libraries that can't find the old version of a shared object. 

However, in this case I have a bit of a hard time finding out what this would be - somewhere along the way I seem to have found a hint to ld or rather, binutils. However, I'm not absolute sure. 

Is there any easier way to determine by which port a given library was installed?

regards,
Frank,
currently busy with libgcrypt-related rebuilds


----------



## DutchDaemon (Jul 11, 2011)

Look into the *-W* flag of pkg_info(1).


----------



## fmw (Jul 12, 2011)

Now that yielded nothing on ld.elf.so.1
That in turn led me the right track, and I found the answer in /usr/src/libexec/rtld-elf.
Silly of me to think that something from the base system should depend on a port...

Anyway, you live, you learn. DutchDaemon, remind me to buy you a beer if our paths should ever cross


----------



## raul_comodoro (Jul 15, 2011)

*May be pkg_tree is a good one...*

Hello Frank

You posted this...
Is there any easier way to determine by which port a given library was installed?

I think that pkg_tree is a good tool because displays the name of the package and a sub-tree of related dependencies.

It is in "ports management", but I believe I've installed using "pkg_add -r".



```
Here a chunk from the output...

$ pkg_tree| more

ORBit2-2.14.17
|\__ python26-2.6.6_1
|\__ perl-5.10.1_3
|\__ pkg-config-0.25_1
|\__ pcre-8.12
|\__ libiconv-1.13.1_1
|\__ gettext-0.18.1.1
|\__ glib-2.26.1_1
|\__ gamin-0.1.10_4
|\__ gio-fam-backend-2.26.1
 \__ libIDL-0.8.13
OpenEXR-1.6.1_2
|\__ pkg-config-0.25_1
 \__ ilmbase-1.0.1_1
Xaw3d-1.5E_3
|\__ xextproto-7.1.1
|\__ kbproto-1.0.5
|\__ pkg-config-0.25_1
|\__ xproto-7.0.16
|\__ libXau-1.0.6
|\__ libXdmcp-1.0.3
|\__ libICE-1.0.7,1
|\__ libSM-1.1.1_3,1
|\__ libpthread-stubs-0.3_3
|\__ libxcb-1.7
|\__ libX11-1.3.6,1
|\__ libXt-1.0.9
|\__ libXext-1.1.2,1
|\__ libXpm-3.5.7
 \__ libXmu-1.0.4,1
a2ps-letter-4.13b_4
 \__ perl-5.10.1_3
aalib-1.4.r5_4
|\__ kbproto-1.0.5
|\__ pkg-config-0.25_1
|\__ xproto-7.0.16
|\__ libXau-1.0.6
|\__ libXdmcp-1.0.3
|\__ libpthread-stubs-0.3_3
|\__ libxcb-1.7
 \__ libX11-1.3.6,1
....
....
```

Use "more" to manage the output or send the output to a file


----------

