Hack 69 Repair RPM Packages

 < Day Day Up > 

figs/moderate.gif figs/hack69.gif

Knoppix not only comes with Debian packaging tools; it also comes complete with support for creating and installing RPMs .

While it might not be news to you that Knoppix comes with Debian packaging tools, it might surprise you to know that Knoppix also comes with many corresponding RPM packaging tools, including rpm , rpmbuild , rpmquery , and rpmverify . With these tools, you can actually use Knoppix to repair packages on an RPM-based system that is preventing it from booting.

This hack is actually very similar to [Hack #68] , as it makes use of the --root option of rpm , which allows it to install packages from within a chrooted environment. This example uses the same scenario as the previous hacka broken modutils package that prevents the system from booting correctly.

To fix this problem, go to the package repository for your distribution, find the previous version of the modutils package, and copy it to your home directory. Then mount the root directory for your distribution read/write (in this example, /dev/hda1) . Once the partition is mounted, install the modutils package with:

 knoppix@tty0[knoppix]$  sudo rpm --root  /mnt/hda1    -i  modutils-version.i386.rpm   

You can also use the same method to repair rpm itself if it is broken or corrupted, because you wouldn't be able to use rpm on the system to fix itself. Download the replacement rpm package from your distribution package repository, and then run:

 knoppix@tty0[knoppix]$  sudo rpm --root  /mnt/hda1    -i  rpm-version.i386.rpm   

Or use tar and alien to fix rpm with:

 knoppix@tty0[knoppix]$  sudo alien --to-tgz  rpm-version.i386.rpm   knoppix@tty0[knoppix]$  sudo mv  rpm-version.tgz /mnt/hda1   knoppix@tty0[knoppix]$  cd  /mnt/hda1   knoppix@tty0[knoppix]$  tar xzvf  rpm-version.tgz   

With all of the included rpm tools, you definitely want access to a Knoppix disc for system rescue even if you don't run Debian. Similar to Debian repair, do most of your repairs from within the system itself if you can, and use Knoppix to repair those packages that are preventing you from booting or any other packages you can't fix within the system itself.

 < Day Day Up > 

Knoppix Hacks. 100 Tips and Tricks
Knoppix Hacks. 100 Tips and Tricks
Year: 2004
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net