Linux 由于依赖 /bin/sh not found,rpm 安装失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3959040/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 23:43:01  来源:igfitidea点击:

rpm installation fails due to depencency /bin/sh not found

linuxrpm

提问by crystal

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

我正在尝试使用 rpm 安装一个包,为此我创建了一个不同的数据库,rpmdb --initdb --dbpath $HOME/myrpmdb并在安装时在 --dbpath 中指定了该路径。我得到的错误是

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?

和 /bin/sh 存在 有什么方法可以将其指定给安装程序吗?在创建不同的 rpm 数据库的过程中,我是否遗漏了什么原因,现在它无法对默认命令进行优化?

回答by Ignacio Vazquez-Abrams

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

因为您已经告诉它使用一个完全不同的数据库,所以 rpm 不会查看/bin/sh可以找到的系统数据库。

回答by thekbb

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

为什么要使用不同的 rpm 数据库?应该有一个非常好的理由走这条路......

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

如果你必须有一个私有的 rpm db,你可以将系统 db 复制到你的私有 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.

使用 --nodeps 安装可能是最简单的方法...复制 rpm db 确实是次优的,它很快就会过时并且不能反映系统的状态。

回答by Minto Joseph

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.

发生这种情况是因为 bash rpm 在新的 rpmdb 路径中不可用。您必须使用以下命令来安装 rpm。

# rpm --dbpath $HOME/myrpmdb --nodeps -ivh XXX.rpm

回答by burtsevyg

Right way install rpm via alien:

通过外星人安装 rpm 的正确方法:

alien -i my_rpm_name.rpm

If alien is not installed:

如果没有安装外星人:

sudo apt-get install alien