centos7 安裝rpm包依賴問題
通常我們安裝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!