16

When I install a rpm package on RHEL using rpm, I got a error message just like "Failed dependencies: /bin/sh is needed by xxx".

I checked that /bin/sh is there and it links to /bin/bash and bash works well.

I found a solution that to add --nodeps to the rpm command to solve this problem. But I really want to know what is the root cause?

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
Jeff7566
  • 432
  • 1
  • 5
  • 20

3 Answers3

11

How to reproduce this error on a fresh install of Ubuntu 14.04.

  1. Fresh install of Ubuntu 14.04
  2. Do a sudo apt-get install rpm
  3. download the nomachine rpm 64 bit linux from https://www.nomachine.com/download/download&id=4
  4. Do a chmod +x nomachine_4.2.25_1_x86_64.rpm on it
  5. extract it like this:

    el@apollo:~Desktop$ sudo rpm -i nomachine_4.2.25_1_x86_64.rpm
    rpm:  RPM should not be used directly install RPM packages, use Alien instead!
    rpm: However assuming you know what you are doing...
    error: Failed dependencies:
    /bin/sh is needed by nomachine-4.2.25-1.x86_64
    
  6. So that is the error. To fix it I followed its advice to use alien.

    sudo alien -i nomachine_4.2.25_1_x86_64.rpm --scripts
    

And no machine installed correctly.

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
4

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"".

Jeff7566
  • 432
  • 1
  • 5
  • 20
0

seems to me as though there is most likely a problem with your RPM database. Have you removed or modified it in any way lately? I'd start with the Fedora documentation that explains how to rebuild the database.

Forrest
  • 1,370
  • 9
  • 20
  • Before I used the "--nodeps" to solve this problem, I have tried using "rpm --rebuilddb", but it does not work. – Jeff7566 Mar 06 '13 at 04:30