Jump to content

We use cookies to log you in, for ads and for analytics. OK

- - - - -

extract 1 file from RPM

  • Please log in to reply
1 reply to this topic

#1 hijinks


    touch /dev/booty

  • Members
  • PipPipPip
  • 292 posts

Posted 14 January 2004 - 08:04 PM

Do you want to extract a file from an rpm package, but don't want to install the whole rpm to get it? Well here is how you do it. I am going to grab htpasswd from the httpd rpm

To find out where the file will get installed if you install the whole package run this command

rpm -qlp httpd-2.0.40-21.i386.rpm | grep htpasswd

Now that i have /usr/bin/htpasswd as the location I can use rpm2cpio to grab just that file.

rpm2cpio httpd-2.0.40-21.i386.rpm | cpio -ivd ./usr/bin/htpasswd

That should place a file in ./usr/bin/htpasswd Notice I have a . (period) in front. It will create the usr/bin and then place htpasswd in that dir in whatever dir you are in. So in my example i was in /tmp so all the full path to htpasswd is


From there i could move it to /usr/bin and delete /tmp/usr and also the rpm.

another one from J to the Y

#2 Ritter



  • Members
  • PipPip
  • 66 posts

Posted 14 January 2004 - 08:13 PM

LOL, we both added at almost the same time. Yours being much better, so I killed mine. Thanks again!
Edler Rittersmann
build a man a fire and he is warm for a day.
light a man on fire and he is warm for the rest of his life.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users