Results 1 to 10 of 15
Hi guys, I have no idea what I did but I somehow managed to delete yum .
So when I try to run "yum update", it gives me the following ...
- 09-29-2011 #1Just Joined!
- Join Date
- Sep 2011
- Posts
- 9
Accidentally deleted yum :(
Hi guys, I have no idea what I did but I somehow managed to delete yum.
So when I try to run "yum update", it gives me the following error
-bash: yum: command not found
I tried to follow this methods from this link but it does NOT work!
deadlockprocess.wordpress.com/2010/07/18/how-to-reinstall-rpm-and-yum-without-rpm-and-yum-in-centosrhel/]How-To: Reinstall rpm and yum without rpm/yum in CentOS/RHEL « mundane idiosyncrasies
To be on clear side, yes I am logged in as Root. I am running CentOS 5.6 32-bit.
PLEASE help me by tracing me through steps on solving this mess. I am willing to even pay you through paypal!
- 09-29-2011 #2
Hello and Welcome!
Could you give a little detail on what didn't work?I tried to follow this methods from this link but it does NOT work!
How-To: Reinstall rpm and yum without rpm/yum in CentOS/RHEL « mundane idiosyncrasies
Any error messages that may have come up, and on which step?Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.
- 09-29-2011 #3Just Joined!
- Join Date
- Sep 2011
- Posts
- 9
$ mkdir /tmp/install && cd /tmp/install
$ wget -c vault.centos.org/4.1/os/i386/CentOS/RPMS/rpm-4.3.3-9_nonptl.i386.rpm
$ rpm2cpio rpm-4.3.3-9_nonptl.i386.rpm | cpio -dim
$ find . -type d -exec chmod 755 {} \;
$ tar cf - ./usr ./etc ./bin | (cd /; tar xvf -)
$ rpm --rebuilddb
$ rpm -i rpm-4.3.3-9_nonptl.i386.rpm
In the last line (above), rpm has to be re-installed to update
The only line I modified is the bolded one. I changed the 4.1 to 5.6 which is what I am running. When I don't modify it, it works. However, the following step does NOT, regardless whether I modify it or not.
When running "rpm2cpio rpm-4.3.3-9_nonptl.i386.rpm | cpio -dim", I am presented with this error
-bash: rpm2cpio: command not found
cpio: premature end of archive
- 09-29-2011 #4Just Joined!
- Join Date
- Sep 2011
- Posts
- 15
Hi,
You need to arrange any image file of your Operating System or Red hat Enterprise Linux where you can find all the rpms.
If you have one, then may be I can help you.
- 09-29-2011 #5Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
I don't see why you need to do any extra rigamarole, just download and install it from centos.org...
Or if you don't have an internet connection, install it from the installation media that you must have lying around.Code:wget http://vault.centos.org/5.6/os/i386/CentOS/yum-3.2.22-33.el5.centos.noarch.rpm rpm -Uvh yum-3.2.22-33.el5.centos.noarch.rpm
- 09-29-2011 #6Just Joined!
- Join Date
- Sep 2011
- Posts
- 9
Thanks for answering guys. I really appreciate it.
I can do wget but i cannot do rpm command. When I run rpm, it gives me this error:
Also, I am a student. My instructor is, how can I say it politely, not helpful at all. His method of making us learn is "go research it. Find out yourself." I am doing just that but cannot seem to get any far. Plus I can't focus on other courses when I do that. I have been at this problems for 2 days now!Code:-bash: rpm: command not found
So I am using one of the servers from my school. He gives out a machine with a IP address. I use that IP address to connect from anywhere using PuTTY. So me popping in a centOS disc, I think, is out of question?
I am really willing to pay you some money through paypal, even!
Thank you so much!
- 09-29-2011 #7Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
If the rpm utility is not found on the CentOS server, then I suspect something is up...that is very out of the ordinary.
If you don't have physical access to the machine (which it sounds like you don't), then you've got quite a hurdle in front of you.
You could get rpm on there by using another Linux PC. On this other PC, you could download the rpm file from the CentOS website:
Then convert it to cpio:Code:cd /tmp wget http://vault.centos.org/5.6/os/i386/CentOS/rpm-4.4.2.3-22.el5.i386.rpm
Then uncompress the cpio:Code:rpm2cpio < rpm-4.4.2.3-22.el5.i386.rpm > rpm.cpio
Then tar it up:Code:mkdir rpm-4.4.2.3-22.el5.i386 cd rpm-4.4.2.3-22.el5.i386 cpio -idv < ../rpm.cpio
Then copy it to the broken CentOS machine and untar it:Code:cd .. tar cf rpm-4.4.2.3-22.el5.i386.tar rpm-4.4.2.3-22.el5.i386
This all assumes you have root access on the broken CentOS machine.Code:tar -C / -xf rpm-4.4.2.3-22.el5.i386.tar
This is all at your own risk, you may very likely break your system even more by following this suggestion!
- 09-29-2011 #8Just Joined!
- Join Date
- Sep 2011
- Posts
- 9
I was able to do the steps up until wget.
When I try to do
I get this errorCode:rpm2cpio < rpm-4.4.2.3-22.el5.i386.rpm > rpm.cpio
rpm2cpio < rpm-4.4.2.3-22.el5.i386.rpm > rpm.cpio
-bash: rpm2cpio: command not found
No!
- 09-29-2011 #9Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Are you doing these commands on another Linux PC that has working yum/rpm already? If so, what distro are you using?
- 09-29-2011 #10Just Joined!
- Join Date
- Sep 2011
- Posts
- 9
No. I am doing it on the broken linux that I am connecting to through PuTTY terminal.


Reply With Quote