Installing a single file from an RPM into a system running SELinux

Michael Schwendt mschwendt at gmail.com
Sun May 12 13:32:09 UTC 2013


On Sat, 11 May 2013 15:07:04 -0700, Jonathan Ryshpan wrote:

> On Sat, 2013-05-11 at 14:16 -0700, Joe Zeff wrote:
> > On 05/11/2013 01:40 PM, Jonathan Ryshpan wrote:
> > > I need to install a single file from an RPM, namely
> > >
> > >   * RPM gnome-keyring-3.6.3-1.fc18.i686
> > >   * File: /usr/lib/pkcs11/gnome-keyring-pkcs11.so
> > 
> > The first thing you need to do is RTFM:
> > 
> > rpm -i gnome-keyring-3.6.3-1.fc18.i686 -f gnome-keyring-pkcs11.so
> > 
> > should do the trick.  (Please note that I haven't actually done this, 
> > but man rpm tells me that it will work and I presume that whoever wrote 
> > that knew what they were doing.)
> 
> If only.  The -f option applies only to queries,

Not true.

> eg.
>         $ rpm -qf /usr/lib64/pkcs11/gnome-keyring-pkcs11.so
>         gnome-keyring-3.6.3-1.fc18.x86_64
> to discover which rpm provides the specified file.  
> 
> Just to make sure, I tried the following, adding a ".rpm" in case of a
> typo.
>         $ rpm -i gnome-keyring-3.6.3-1.fc18.i686 -f gnome-keyring-pkcs11.so
>         error: gnome-keyring-3.6.3-1.fc18.i686: not an rpm package (or package manifest): 
>         error: open of gnome-keyring-pkcs11.so failed: No such file or directory
>         $ rpm -i gnome-keyring-3.6.3-1.fc18.i686.rpm -f gnome-keyring-pkcs11.so
>         error: open of gnome-keyring-pkcs11.so failed: No such file or directory
> 

Well, obviously the RPM package to install must be available as a local
file. The "No such fule or directory" error message should be clear in this
regard.

Back to option -f, it's a list of packages when used with e.g. -i,
so you can do stuff like

  rpm -if /example/list.txt

with "list.txt" containing a list of package file names.

About the original problem, it's possible to restore a single file via
rpm2cpio, and its security context with restorecon. Unless the package
does special things in its %post scriptlet.

-- 
Fedora release 19 (Schrödinger’s Cat) - Linux 3.9.1-301.fc19.x86_64
loadavg: 0.15 0.15 0.12


More information about the users mailing list