科学linux:如何使用rpm安装yum?

科学linux:如何使用rpm安装yum?

在 Scientific Linux 6.0(类似 Linux 的 RH)上,我意外删除了 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

答案1

下载软件包并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

相关内容