Rpm Installation Fails Due to Depencency /Bin/Sh Not Found

What's the root cause of error Failed dependencies: /bin/sh is needed by xxx on RHEL?

I have find root cause for this problem. The rpm-libs is missing on my machine. I reinstall rpm-libs then everything is ok. Note: After installing rpm-libs, if the problem still exists, please try "rpm -v --rebuilddb --define="_rpmlock_path /var/lock/rpm"".

Error while installing RPM -%post script of spec-failed dependencies /bin/sh

%post -p /bin/bash

That will give your post script a terminal to run bash commands and all that you are doing into it.

rpm install file exist issue

I'll give you my thoughts, I see two possible scenarios here:

A) You did not install /usr/lib/libapr-1.so.0 via RPM, so RPM would not have any record of it in its package database. RPM only knows about files that were properly installed via an RPM package. This can be checked by asking RPM where it thinks those files came from:

rpm -qf /usr/lib/libapr-1.so.0 /usr/lib/libapr-1.so.0.3.9

B) You are installing something that requires the 64bit version of libapr-1.so.0 and you only have the 32bit version installed (/usr/lib is normally where all the 32bit or noarch stuff is stored for RedHat/Fedora/Centos, /usr/lib64 would have the 64bit libraries). Unless you have a 64bit system, you should probably be installing 32bit RPMs.

Hope that helps

rpm package installation issue with nodeps flag

The right thing to do at this point is not use RPM. By messing with the root, and then saying "I don't care about dependencies," you're in no man's land. The scripts are trying to do things they cannot, and you're not providing enough information to actually tell you what's wrong.

The easiest solution is to go to a temporary directory and runrpm2cpio your.rpm | cpio -div and then copy the resulting file tree where it needs to be installed.

So I'm not accused of not answering the actual question, you can do --noscripts, but then you'll be here tomorrow asking why the program didn't work when you didn't use the support infrastructure that is RPMs to get it done in the first place.

How to make rpm auto install dependencies

Create a (local) repository and use yum to have it resolve the dependencies for you.

The CentOS wiki has a nice page providing a how-to on this. CentOS wiki HowTos/CreateLocalRepos.


Summarized and further minimized (not ideal, but quickest):

  1. Create a directory for you local repository, e.g. /home/user/repo.
  2. Move the RPMs into that directory.
  3. Fix some ownership and filesystem permissions:

    # chown -R root.root /home/user/repo
  4. Install the createrepo package if not installed yet, and run

    # createrepo /home/user/repo
    # chmod -R o-w+r /home/user/repo
  5. Create a repository configuration file, e.g. /etc/yum.repos.d/myrepo.repo containing

    [local]
    name=My Awesome Repo
    baseurl=file:///home/user/repo
    enabled=1
    gpgcheck=0
  6. Install your package using

    # yum install packagename


Related Topics



Leave a reply



Submit