LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   /usr/lib and /usr/local/lib (https://www.linuxquestions.org/questions/slackware-14/usr-lib-and-usr-local-lib-193233/)

doxxan 06-14-2004 03:13 AM

/usr/lib and /usr/local/lib
 
Hi.
I had some problems compiling pango and gtk+ when I noticed that /usr/lib had symlinks to older libraries. I also noticed that the new symlinks were in /usr/local/lib, although it seems that libs should be installed in /usr/lib. So, I moved everything from /usr/local/lib to /usr/lib/, and simply symlinked /usr/local/lib to /usr/lib. I just wonder, is this correct? Why is there two separate lib dirs? Will something break in the future for doing this? System seems to work as of yet though.

Appreciate any feedback,
Doxxan

keefaz 06-14-2004 03:32 AM

The /etc/ld.so.conf file main interest is to avoid symlink /whatever/lib/dir to /usr/lib
just put the path of /whatever/lib/dir in /etc/ld.so.conf and then, do ldconfig to take in account the changes, after that all programs find the correct libraries needed.

doxxan 06-14-2004 03:56 AM

tnx alot keefaz, I'll have a look at ld.so.conf :)

thegeekster 06-14-2004 12:33 PM

Re: /usr/lib and /usr/local/lib
 
Quote:

Originally posted by doxxan
Hi.
I had some problems compiling pango and gtk+ when I noticed that /usr/lib had symlinks to older libraries. I also noticed that the new symlinks were in /usr/local/lib, although it seems that libs should be installed in /usr/lib. So, I moved everything from /usr/local/lib to /usr/lib/, and simply symlinked /usr/local/lib to /usr/lib. I just wonder, is this correct? Why is there two separate lib dirs? Will something break in the future for doing this? System seems to work as of yet though.

Appreciate any feedback,
Doxxan

If you compiled pango and gtk+, you most likely didn't specify a "--prefix=" path. The default path for a lot of packages is "/usr/local"....................The official Slackware packages mostly use "--prefix=/usr", so if you have any of the official packages installed, you will see libs in both places............I would recommend removing the old packages to avoid possible conflicts..................

And there are more than two locations for libs, depending on the packages installed.................X and KDE, for example, have their own lib directories, which is where the /etc/ld.so.conf file keefaz mentioned comes into play...........ld.so.conf is for lib paths other than the two defaults of ".usr/lib" and "/usr/local/lib" (these two don't need to be entered in ld.so.conf)..............

And don't move anyhthing around.................now when you try to remove some packages, they won't be able to find the libs you moved, which will remain on your system and you will have to manually remove them.............To find out what goes where, you will need to look in /var/log/packages/<package_name> and /var/log/scripts/<package_name> (for symlinks) to find out what goes where............And if you already removed any packages after moving those libs, then you will need to look in /var/log/removed_packages and /var/log/removed_scripts to find out what was not removed that was supposed to get removed...........

HTH :)


PS: The main reason for symlinks for libs is to avoid using versions in the lib names...........

ringwraith 06-14-2004 04:25 PM

If you are going to install from source a package that is already installed, you should removepkg the old one. I would also recommend using an app such as checkinstall to install it rather than just make install it. That way you will be able to remove the newly installed package when the time comes to upgrade it again.

doxxan 06-15-2004 12:58 AM

tnx for all the replies. :D

I've tried checkinstall in the past, and had trouble with it. But, I'll give it another go.

tnx alot guys :),
Doxxan


All times are GMT -5. The time now is 02:15 PM.