Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
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 ...
  1. #1
    Just 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!

  2. #2
    Trusted Penguin jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    4,071
    Hello and Welcome!
    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
    Could you give a little detail on what didn't work?
    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.

  3. #3
    Just 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

  4. #4
    Just 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.

  5. #5
    Linux 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...
    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
    Or if you don't have an internet connection, install it from the installation media that you must have lying around.

  6. #6
    Just 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:

    Code:
    -bash: rpm: command not found
    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!

    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!

  7. #7
    Linux 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:
    Code:
    cd /tmp
    wget http://vault.centos.org/5.6/os/i386/CentOS/rpm-4.4.2.3-22.el5.i386.rpm
    Then convert it to cpio:
    Code:
    rpm2cpio < rpm-4.4.2.3-22.el5.i386.rpm > rpm.cpio
    Then uncompress the cpio:
    Code:
    mkdir rpm-4.4.2.3-22.el5.i386
    cd rpm-4.4.2.3-22.el5.i386
    cpio -idv < ../rpm.cpio
    Then tar it up:
    Code:
    cd ..
    tar cf rpm-4.4.2.3-22.el5.i386.tar rpm-4.4.2.3-22.el5.i386
    Then copy it to the broken CentOS machine and untar it:
    Code:
    tar -C / -xf rpm-4.4.2.3-22.el5.i386.tar
    This all assumes you have root access on the broken CentOS machine.

    This is all at your own risk, you may very likely break your system even more by following this suggestion!

  8. #8
    Just Joined!
    Join Date
    Sep 2011
    Posts
    9
    I was able to do the steps up until wget.

    When I try to do

    Code:
    rpm2cpio < rpm-4.4.2.3-22.el5.i386.rpm > rpm.cpio
    I get this error

    rpm2cpio < rpm-4.4.2.3-22.el5.i386.rpm > rpm.cpio
    -bash: rpm2cpio: command not found



    No!

  9. #9
    Linux 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?

  10. #10
    Just Joined!
    Join Date
    Sep 2011
    Posts
    9
    No. I am doing it on the broken linux that I am connecting to through PuTTY terminal.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...