Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After doing yum remove crontabs this appears after running yum: -bash: /usr/bin/yum: No such file or directory

This was the output of 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: set to be erased
--> Processing Dependency: rpm = for package: rpm-python
--> Processing Dependency: rpm = 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: set to be erased
---> Package rpm-python.x86_64 0: 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
 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                                                               installed                                     3.6 M
 rpm-libs                                          x86_64                                                               installed                                     2.0 M
 rpm-python                                        x86_64                                                               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 

  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:         rpm-libs.x86_64 0:        
  rpm-python.x86_64 0:                    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        


Any ideas on how to re-install YUM without YUM itself? Thanks :D

share|improve this question

migrated from Jul 23 '11 at 21:04

This question came from our site for professional and enthusiast programmers.

You did notice that you don't even have rpm anymore, right? – Ignacio Vazquez-Abrams Jul 23 '11 at 20:23
Yes, i did... :( – Justin Jul 23 '11 at 20:34
up vote 6 down vote accepted

It's possible to install RPM by unpacking the files from the RPM-rpm (uhuh) package. This will get you going again and you will be able to install yum as well. First create the directory you are going to use for unpacking the files from the RPM archive and download the RPM package.

mkdir /tmp/becarefulnexttime
cd /tmp/becarefulnexttime

Make sure you download the RPM version corresponding to your CentOS version / architecture, but looking at your yum output I think this is.

Now, extract the files from the RPM archive and copy the important files to your CentOS installation root.

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

You should have a working rpm command now, rebuild the RPM database and install RPM properly:

rpm --rebuilddb
rpm -i rpm-

You might need some extra dependencies you removed earlier but it should now be possible to install yum again

rpm -i
share|improve this answer
It throws this error when using find . -type d -exec chmod 755 {} ;: find: missing argument to `-exec' – Justin Jul 23 '11 at 21:53
@Justin Missing backslash before the semicolon, edited in my post. – PowerSp00n Jul 23 '11 at 21:56
Could you please explain to me why yum tries to uninstall yum and rpm at all when removing some random package? I ran into this when uninstalling openldap. Thanks in advance! (+1) – atamanroman Sep 12 '11 at 12:16

You could probably recompile the rpm package manually, install that, then install yum, but unless this is a mission-critical box it'd be quicker to backup your configuration and reinstall, probably.

share|improve this answer

Try the source installation from tar ball.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.