aguilarojo wrote:Background of the problem:
Sometimes a package available within a YDL release is old in comparison to what may be current. For example to use the current release of GPG2 which allows for use of OpenPGP one of the libraries I need is libgcrpyt-1.4.4 but I need to have the version installed by anaconda removed. It just so happens that removing it using yum affects over 300+ other installed packages, which means that I have to find a means of having those same 300+ packages find and discover the new version of libgcrypt!
Well - not exactly. All 300+ of those programs are using the only registered version of libgcrypt on your system - most likely libgcrypt-1.2.3-1. That's the way RPM works - when you install libgcrypt with RPM, it updates a database so that any other RPM based installers can find it.
Internally, RPM installs have a dependency requirement and a minimum version. So - all of those 300+ packages require libgcrypt - but you'd have to look at each package's original spec to see what minimum version of libgcrypt they require. When you go to uninstall something, it checks that RPM database, and prints warnings if any other RPM installs depend on it..
You can see the registered versions of all the files RPM knows about by using
rpm -qa I use this to find which version of something is installed by filtering it with grep. i.e.:
rpm -qa | grep libgcryptThe nice thing about this is that you can update registered RPMs with newer versions with a simple download and RPM command.
As an example, if you had a PowerPC RPM of libgcrypt-1.4.4, you could just update the RPM database and all associated files with
rpm -Uvh libgcrypt-1.4.4.ppc.rpm (or whatever the downloaded RPM is called)
Of course, if the new libgcrypt has other dependencies, it won't install unless all the other dependencies are resolved. This is why we use YUM - it automates all this downloading for us.
I tried researching this problem in other Linux forums and references and have learned much about spec files and so on. What I haven't found, even on IBM's website discussing rpm, is a logically procedural based answer.
I'm hoping that my query can be addressed here. Any takers?
The best place to find info about RPM is on Red Hat websites, not IBM. They invented it. (RPM originally stood for RedHat Package Manager - now it stands for RPM Package Manager. Recursive acronyms are fun!
)
As for what you'd need to do - if you can't find a newer PowerPC RPM of libgcrypt to download - you'd need to build a new version from source. Then, you'd have a couple of choices, depending on how much source control you want on your system.
Option A - you configure your source code to build in an unused directory then edit /etc/ld.so.conf to point at it. This way, you can build newer libraries without disturbing your base YDL libraries.
An example of this is here:
viewtopic.php?f=19&t=3793&p=17013#p17013You will have to build all dependent libraries with this method - but you won't trash your YDL install this way.
Option B - take the source code, build it, then create an RPM from it. This is harder than it sounds - well - for me anyway. billb has done this, I think. It's not for the faint of heart.
Option C - rebuild an SRPM from a newer distribution, then install it. For example - if you go here:
http://mirrors.versaweb.com/centos/5.3/os/SRPMS/you can see that there is an SRPM for libgcrypt: libgcrypt-1.2.4-1.el5.src.rpm
Building SRPMS isn't too difficult - you create a series of subfolders on your hard disc in a folder. I use a folder in my home directory called rpm for this, then the subfolders - in all caps - are BUILD, RPMS, SOURCES, SPECS, SRPMS. After that, create a file called .rpmmacros in your home directory that tells RPM where to find your build tree. Mine looks like this:
- Code: Select all
%_topdir /home/paulp/rpm
Then, download the SRPM wherever you like, and build it with this command:
setarch ppc32 rpmbuild --ppc --rebuild foo.src.rpmWhere foo.src.rpm is the name of the SRPM you downloaded.
We've found that you need the setarch ppc32 and --ppc arguments to correctly build for PowerPC.
After it finishes, you can just install it with
rpm -Uvh newrpm.rpmThis would be the best way to do it. This is the way I generate the community builds of Firefox 3 for YDL directly from the CentOS repositories.
Cheers,
Paul