linux – 删除了YUM? CentOS 5.5

前端之家收集整理的这篇文章主要介绍了linux – 删除了YUM? CentOS 5.5前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在做了yum之后删除了crontabs,这在运行yum之后出现:-bash:/usr/bin/yum:没有这样的文件或目录

这是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

解决方法

可以通过从RPM-rpm(uhuh)包解压缩文件来安装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
原文链接:https://www.f2er.com/linux/399149.html

猜你在找的Linux相关文章