Operating System - Linux
1820072 Members
3212 Online
109608 Solutions
New Discussion юеВ

rpm - single file installation from rpm package

 
SOLVED
Go to solution
Matthias Bayer
Advisor

rpm - single file installation from rpm package

Hi,

i am searching for a possibility to install just one file out of an rpm-package without having to install all files out of the rpm package, does anybody know how to do this ?
example:
i want to replace my /bin/mount' command on my running system out of the package 'mount-2.11y-31.1.i386.rpm' from the CD without installing all other files from 'mount-2.11y-31.1.i386.rpm'.

thanks for any help.

regards,
Matthias
3 REPLIES 3
Sergejs Svitnevs
Honored Contributor

Re: rpm - single file installation from rpm package

Hi
Using rpmget script, you can easily extract a specified file from a rpm.

Regards,
Sergejs
Paul_504
Frequent Advisor
Solution

Re: rpm - single file installation from rpm package

Hi Matthias

I personally don't have the rpmget script, so I use the following method.

Run this command against the package from which you want to extract the mount command:

rpm2cpio |cpio -i --make

Preferably run this in say your /tmp directory, as the --make command makes all the directories as mentioned by the paths of files within the rpm package.

For instance, mount is located in /bin/mount, so the above command will create a bin directory relative to /tmp, i.e /tmp/bin. Within this directory you'll find the mount command. Either mv or cp it to the original location, as you prefer. Once complete, you can just clean up your /tmp directory again.

This is an option if like me, you don't have rpmget, otherwise that would be a preferable option.

Regards
Paul
Manuel Wolfshant
Trusted Contributor

Re: rpm - single file installation from rpm package

you could also use mc (midnight commander) to select any number of files inside the rpm and extract them. behind the scene mc will call cpio for you.