Linux

Scientific linux:如何使用 rpm 安裝 yum?

  • September 15, 2011

在 Scientific linux 6.0(RH like linux)上,我不小心刪除了 python,所以也刪除了 yum。µ

如何用 rpm 安裝 yum?

編輯

我嘗試安裝python,但它以某種方式循環依賴:

rpm -Uvh http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/python-libs-2.6.5-3.el6.x86_64.rpm
   Retrieving http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/python-libs-2.6.5-3.el6.x86_64.rpm
   error: Failed dependencies:
           python = 2.6.5-3.el6 is needed by python-libs-2.6.5-3.el6.x86_64

然後:

rpm -Uvh http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/python
-2.6.5-3.el6.x86_64.rpm
Retrieving http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/python-2.6.5-3.el6.x86_64.rpm
error: Failed dependencies:
       libpython2.6.so.1.0()(64bit) is needed by python-2.6.5-3.el6.x86_64

下載軟體包並rpm -Uvh <packagenames>以 root 或sudo rpm -Uvh <packagenames>普通使用者身份輸入

我曾經rpm -qpR yum-3.2.27-14.el6.noarch.rpm得到一個 yum 的依賴項列表,希望能一次性完成所有依賴項:

使用以下程式碼塊下載所有包:

wget http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/python-2.6.5-3.el6.x86_64.rpm \
http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/python-libs-2.6.5-3.el6.x86_64.rpm \
http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm \
http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/pygpgme-0.1-18.20090824bzr68.el6.x86_64.rpm \
http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/python-urlgrabber-3.9.1-7.el6.noarch.rpm \
http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/python-pycurl-7.19.0-5.el6.x86_64.rpm \
http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/rpm-python-4.8.0-12.el6.x86_64.rpm \
http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/yum-3.2.27-14.el6.noarch.rpm \
http://ftp2.scientificlinux.org/linux/scientific/6.0/x86_64/os/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm

按如下方式安裝它們:

rpm -Uhv py*.rpm \
  yum*.rpm \
  rpm-py*.rpm

引用自:https://serverfault.com/questions/297088