删除了 YUM?CentOS 5.5

删除了 YUM?CentOS 5.5

完成此操作后,yum remove crontabs运行后出现yum-bash: /usr/bin/yum: No such file or directory

这是输出yum remove crontabs

[root@vs270 opt]# yum remove crontabs
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package crontabs.noarch 0:1.10-8 set to be erased
--> Processing Dependency: crontabs for package: rpm
--> Running transaction check
---> Package rpm.x86_64 0:4.4.2.3-20.el5_5.1 set to be erased
--> Processing Dependency: rpm = 4.4.2.3-20.el5_5.1 for package: rpm-python
--> Processing Dependency: rpm = 4.4.2.3-20.el5_5.1 for package: rpm-libs
--> Processing Dependency: rpm >= 3.0.5 for package: apt
--> Processing Dependency: rpm >= 4.4.2 for package: yum
--> Running transaction check
---> Package apt.x86_64 0:0.5.15lorg3.94a-5.el5.rf set to be erased
---> Package rpm-libs.x86_64 0:4.4.2.3-20.el5_5.1 set to be erased
---> Package rpm-python.x86_64 0:4.4.2.3-20.el5_5.1 set to be erased
---> Package yum.noarch 0:3.2.22-26.el5.centos set to be erased
--> Processing Dependency: yum >= 3.0 for package: yum-fastestmirror
--> Running transaction check
---> Package yum-fastestmirror.noarch 0:1.1.16-14.el5.centos.1 set to be erased
--> Processing Dependency: /bin/rpm for package: policycoreutils
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package policycoreutils.x86_64 0:1.33.12-14.8.el5 set to be erased
--> Processing Dependency: policycoreutils >= 1.33.12-14.5 for package: selinux-policy
--> Processing Dependency: policycoreutils for package: setools
--> Running transaction check
---> Package selinux-policy.noarch 0:2.4.6-279.el5_5.2 set to be erased
---> Package setools.x86_64 0:3.0-3.el5 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================================
 Package                                           Arch                                   Version                                                   Repository                                     Size
====================================================================================================================================================================================================
Removing:
 crontabs                                          noarch                                 1.10-8                                                    installed                                 1.0 k
Removing for dependencies:
 apt                                               x86_64                                 0.5.15lorg3.94a-5.el5.rf                                  installed                                      8.5 M
 policycoreutils                                   x86_64                                 1.33.12-14.8.el5                                          installed                                     2.1 M
 rpm                                               x86_64                                 4.4.2.3-20.el5_5.1                                        installed                                     3.6 M
 rpm-libs                                          x86_64                                 4.4.2.3-20.el5_5.1                                        installed                                     2.0 M
 rpm-python                                        x86_64                                 4.4.2.3-20.el5_5.1                                        installed                                     131 k
 selinux-policy                                    noarch                                 2.4.6-279.el5_5.2                                         installed                                     7.5 M
 setools                                           x86_64                                 3.0-3.el5                                                 installed                                     3.3 M
 yum                                               noarch                                 3.2.22-26.el5.centos                                      installed                                     3.2 M
 yum-fastestmirror                                 noarch                                 1.1.16-14.el5.centos.1                                    installed                                      47 k

Transaction Summary
====================================================================================================================================================================================================
Remove       10 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing        : crontabs                                                                                                                                                                        1/10 
  Erasing        : rpm-python                                                                                                                                                                      2/10 
  Erasing        : yum                                                                                                                                                                             3/10 
warning: /etc/yum.conf saved as /etc/yum.conf.rpmsave
  Erasing        : apt                                                                                                                                                                             4/10 
warning: /etc/apt/sources.list.d/os.list saved as /etc/apt/sources.list.d/os.list.rpmsave
  Erasing        : rpm                                                                                                                                                                             5/10 
  Erasing        : selinux-policy                                                                                                                                                                  6/10 
  Erasing        : policycoreutils                                                                                                                                                                 7/10 
  Erasing        : rpm-libs                                                                                                                                                                        8/10 
  Erasing        : yum-fastestmirror                                                                                                                                                               9/10 
  Erasing        : setools                                                                                                                                                                        10/10 

Removed:
  crontabs.noarch 0:1.10-8                                                                                                                                                                          

Dependency Removed:
  apt.x86_64 0:0.5.15lorg3.94a-5.el5.rf                     policycoreutils.x86_64 0:1.33.12-14.8.el5         rpm.x86_64 0:4.4.2.3-20.el5_5.1         rpm-libs.x86_64 0:4.4.2.3-20.el5_5.1        
  rpm-python.x86_64 0:4.4.2.3-20.el5_5.1                    selinux-policy.noarch 0:2.4.6-279.el5_5.2         setools.x86_64 0:3.0-3.el5              yum.noarch 0:3.2.22-26.el5.centos           
  yum-fastestmirror.noarch 0:1.1.16-14.el5.centos.1        

Complete!

有没有关于如何在没有 YUM 的情况下重新安装 YUM 的想法?谢谢 :D

答案1

可以通过解压 RPM-rpm(啊哈)包中的文件来安装 RPM。这将使您再次开始,并且您还可以安装 yum。首先创建您将用于解压 RPM 存档中的文件的目录并下载 RPM 包。

mkdir /tmp/becarefulnexttime
cd /tmp/becarefulnexttime
wget http://ftp.tudelft.nl/centos.org/5/os/x86_64/CentOS/rpm-4.4.2.3-22.el5.x86_64.rpm

确保您下载了与您的 CentOS 版本/架构相对应的 RPM 版本,但查看您的 yum 输出我认为是这样。

现在,从 RPM 存档中提取文件并将重要文件复制到 CentOS 安装根目录。

rpm2cpio rpm-4.4.2.3-22.el5.x86_64.rpm | cpio -dim
find . -type d -exec chmod 755 {} \;
tar cf - ./usr ./etc | (cd /; tar xvf -)

您现在应该有一个可以工作的 rpm 命令,重建 RPM 数据库并正确安装 RPM:

rpm --rebuilddb
rpm -i rpm-4.4.2.3-22.el5.x86_64.rpm

您可能需要先前删除一些额外的依赖项,但现在应该可以再次安装 yum

rpm -i http://ftp.tudelft.nl/centos.org/5/os/x86_64/CentOS/yum-3.2.22-33.el5.centos.noarch.rpm

答案2

您可能需要手动重新编译 rpm 包,安装它,然后安装 yum,但除非这是一个关键任务箱,否则备份您的配置并重新安装可能会更快。

答案3

尝试从源安装焦油球

相关内容