Ultimate method to install package from linux rescue mode

Sarath Pillai's picture

Installing packages from rescue mode

Let me narrate one of the funniest thing that happened with me, while i was solving a dependency issue a couple of days back.

I was installing some package for my rhel5 machine, and suddenly encountered a dependency issue. As the machine was freshly installed and setup (i dint have most of the developer packages installed!).

And as most of you guys do, even i note down the dependency package name, to search it out in the internet to install manually using rpm command.(and believe me i did solve a lot of yum dependency issues just like this many number of times)

This time the package required to solve the dependency issue was "ruby"!!

There were some mismatch between the versions of glibc-common and glibc package for ruby...So guess what i did??? As usual went and did an rpm remove command for glibc and glibc-common..(winkcommon dont laugh..making mistakes are normal)

the result of removing glibc is evident from the below screen shot.

As you can see i was unable to run a single command!!!! ooops..now its too late!!! (And you all know that, how irritating is it to go behind something, when the task on which you were working is still pending!!)

I thought for while about the possible methods to get back normal!!

The first thing i did was to insert my RHEL DVD inside the machine(Oh common i cant sit and code another glibc on the fly!!!!!am not Linux Torvalds)

Now as usual ran the command "linux rescue" on the boot interface of the installation disk. which took me to the /mnt/sysimage(by chrooting).

Now the first thing you need to do is to find what name the machine has given to the cd rom.(Mine was /dev/hdc). So created a temporary directory under / and mounted /dev/hdc on it.

mount /dev/hdc /mycdrom

Now lets get inside the directory /mycdrom to look for the very famous directory called "Server" where all rpm packages are located. Sitting inside that directory we can install the required package by rpm command as below.

Now --root option given in the above command will make the root directory(/) as /mnt/sysimage. So that it gets installed in our original installation.

Install as many package as required and reboot the machine.!! thats it....In my case i was rescued from that within minutes..!

Rate this article: 
Average: 3.9 (7 votes)

Comments

Thank you. This is informative and important.

I was struggling with the same issue and your blog just saved my whole tiresome work of reinstalling the whole RHEL once again.

If possible can you make a post on Linux Rescue mode. :)

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.