15

i am trying to install a package using rpm, for which i have created a different database using rpmdb --initdb --dbpath $HOME/myrpmdb and specifying that path in the --dbpath while insatlling. The error i am getting is

root@jason:su rpm --dbpath $HOME/myrpmdb -ivh XXX.rpm
error: Failed dependencies:
/bin/sh is needed by XXX

and /bin/sh exist Is there some way that i can specify this to the installer? Is there something i missed during the creation of different rpm database cause of which now it not able to fine the default commands?

crystal
  • 363
  • 1
  • 5
  • 14

4 Answers4

21

Right way install rpm via alien:

alien -i my_rpm_name.rpm

If alien is not installed:

sudo apt-get install alien
Software Engineer
  • 15,457
  • 7
  • 74
  • 102
burtsevyg
  • 3,851
  • 2
  • 29
  • 44
  • This seems to assume that the OP wants to work with Debian-based installation since Alien was developed for those environments. What if they don't need something that understands `*.deb`? Why is it better than `rpm -iU --nodeps XXX.rpm`? – Erich Gubler Apr 15 '19 at 21:40
  • This answer related only for debian system. For CentOS/RHEL/Fedora you can use YUM or DNF package manager to install downloaded rpm file. Its benefit to resolve dependencies required for the package. – burtsevyg Apr 16 '19 at 08:21
  • Yes, but the OP never said anything about a Debian-based system -- that was my point. I think your answer is a good alternative those systems, though! – Erich Gubler Apr 16 '19 at 15:48
6
error: Failed dependencies:
/bin/sh is needed by XXX

This happens because bash rpm is not available in the new rpmdb path. You would have to use following to get the rpm installed.

# rpm --dbpath $HOME/myrpmdb --nodeps -ivh XXX.rpm
Minto Joseph
  • 146
  • 1
  • 5
0

Because you've told it to use a completely different database, rpm doesn't look at the system database which is where /bin/sh would be found.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
0

Why use a different rpm database? There should be a really good reason to go this route...

If you must have a private rpm db, you can copy the system db into your private one cp /var/lib/rpm/* ~/myrpmdb/.

installing with --nodeps may be the easiest way... copying the rpm db is really sub-optimal, it will soon be out of date and not reflect the state of the system.

thekbb
  • 7,668
  • 1
  • 36
  • 61
  • i did try copying the system db into my provate one, but somehow it couldnt find it..my guess is it might be registering the installed modules which is not done when we copy it..but the nodeps option seems to work..but am searching for a way to make it work without it. – crystal Jan 04 '11 at 09:26