通常我们安装rpm包时,先cd xx.rpm进入rpm包目录
然后执行 rpm -ivh xx.rpm
如果没问题那就安装成功了,然而,事情通常都不如我们所愿。
比如:执行命令安装python3.5的时候:
rpm -ivh sclo-python35-python3-py-1.4.34-1.3.el7.noarch.rpm
会报出如下错误:
error: Failed dependencies:
rh-python35-python(abi) = 3.5 is needed by sclo-python35-python3-py-1.4.34-1.3.el7.noarch
rh-python35-python-setuptools is needed by sclo-python35-python3-py-1.4.34-1.3.el7.noarch
rh-python35-runtime is needed by sclo-python35-python3-py-1.4.34-1.3.el7.noarch
除此之外还有很多其他的包也会出现这个问题,那怎么办呢?
经过探索终于发现了解决问题的方法:采用yum的方式安装,yum会自动解决rpm依赖问题
yum install -y sclo-python35-python3-py-1.4.34-1.3.el7.noarch.rpm
结果如下:
Running transaction
Installing : rh-python35-runtime-2.0-2.el7.x86_64 1/6
Installing : rh-python35-python-pip-7.1.0-2.el7.noarch 2/6
Installing : rh-python35-python-setuptools-18.0.1-2.el7.noarch 3/6
Installing : rh-python35-python-3.5.1-11.el7.x86_64 4/6
Installing : rh-python35-python-libs-3.5.1-11.el7.x86_64 5/6
Installing : sclo-python35-python3-py-1.4.34-1.3.el7.noarch 6/6
Verifying : rh-python35-runtime-2.0-2.el7.x86_64 1/6
Verifying : rh-python35-python-pip-7.1.0-2.el7.noarch 2/6
Verifying : rh-python35-python-3.5.1-11.el7.x86_64 3/6
Verifying : rh-python35-python-setuptools-18.0.1-2.el7.noarch 4/6
Verifying : rh-python35-python-libs-3.5.1-11.el7.x86_64 5/6
Verifying : sclo-python35-python3-py-1.4.34-1.3.el7.noarch 6/6
Installed:
sclo-python35-python3-py.noarch 0:1.4.34-1.3.el7
Dependency Installed:
rh-python35-python.x86_64 0:3.5.1-11.el7 rh-python35-python-libs.x86_64 0:3.5.1-11.el7
rh-python35-python-pip.noarch 0:7.1.0-2.el7 rh-python35-python-setuptools.noarch 0:18.0.1-2.el7
rh-python35-runtime.x86_64 0:2.0-2.el7
Complete!