This is a CentOS 5 system, x64, using yum/rpm for package management. The libxml2 is a bit dated, and the Perl XML library I'd like to install (from CPAN) requires a more up-to-date version of the C libxml2 library.

Now I could download the source and build and install into /usr/local.

But they also provide RPMs at ftp://xmlsoft.org/libxml2/. Is it possible to install the RPM in such a way as not to interfere with the system-provided RPM, which I don't want to change or upgrade?

I tried the following:

package-cleanup --problems libxml2-2.7.8-1.x86_64.rpm

But the output appears to indicate that it will replace the system RPM, which is not what I want.

Marking libxml2-2.7.8-1.x86_64.rpm as an update to libxml2-2.6.26-2.1.12.el5_7.2.i386

In addition, when continuing, the command fails with errors.

--> Finished Dependency Resolution
eel2-2.16.1-1.el5.i386 from installed has depsolving problems
  --> Missing Dependency: libxml2.so.2 is needed by package eel2-2.16.1-1.el5.i386 (installed)
libxml2-python-2.6.26-2.1.12.el5_7.2.x86_64 from installed has depsolving problems
  --> Missing Dependency: libxml2 = 2.6.26 is needed by package libxml2-python-2.6.26-2.1.12.el5_7.2.x86_64 (installed)

So back to compiling from source? Or is there a way to use the RPM?


What I'm interested here is side-by-side installation of an RPM into something like /opt or /usr/local or whatever is your --prefix du jour. The RPM should just check that its dependencies are met by the system, but it should under no circumstances attempt to replace or amend anything at all in the system.

2 Answers 2


You can get the srpm or the sources. Most packages will allow you to build them to install to a target under your /home (./configure --prefix=/home/foo). Never built a RPM to do this, but it should also be possible. However, you may need to frig the dependency metadata in the rpm and the name so it doesn't fool RPM's internal database into thinking you've replaced the actual package.

  • Thanks, Tunbridge. I remember having had to change trains there on the way from London to East Grinstead. Or maybe it was where they came to pick me up. Anyway, it sounds like an RPM cannot be installed out-of-the-box into your --prefix of choice? Because if it cannot, compiling from source is likely easier as then you don't have to deal with the RPM mechanics.
    – Lumi
    Commented Feb 15, 2012 at 17:50
  • More likely where they picked you up from. Although they're quite close the train route from Tunbridge Wells to East Grinstead is kind of convoluted - across to Edenbridge, walk to Edenbridge Town station then to Hurst Green and back out to East Grinstead. Commented Feb 15, 2012 at 18:00
  • Well, it was 20 years ago, or even more. Went to see London, and my aunt lives in East Grinstead with her family. I'm from Hamburg. So plus one for Tunbridge and let's call it a day with the boring RPMs. :)
    – Lumi
    Commented Feb 15, 2012 at 22:53

It depends how you want manage your system in future.

You can go on with source compilation but this approach produces a lot of garbage in the system makes in hardly manageable after some time.

If you try to install the RPM, you run into so called "dependency hell". In your case, there two packages that are dependent on old libxml2 library:


There 2 ways to proceed in this situation:

  1. Install newer libxml2 package with --nodeps option:
rpm -Uvh libxml2-2.7.8-1.x86_64.rpm --nodeps

However, note that the dependent software may be incompatible with this new version.

  1. Download new SRC-RPMS for libxml2-python and eel2 and rebuild them against newer version of libxml2. However, I'm not able guarantee that the compilation will succeed.
  • Roman, thanks. There are dozen or two packages depending on the old system-provided libxml2 (attempted to indicate this by ...). That must all stay as it is, I don't want to meddle with it, I have the distinct feeling that things will go awry if I do. I'd like to know if there's a way to install an RPM like you'd install a built in /usr/local or /opt or /what/ever using --prefix as with autoconf?
    – Lumi
    Commented Feb 15, 2012 at 17:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .