Page 80 - DCAP106_OPERATING_SYSTEM_TOOLS
P. 80

Unit 4: Installing Software




                                                                                                Notes
                 Example: # rpm -I penguin-3.26.i386.rpm
          warning: /etc/someconfig saved as /etc/someconfig.rpmsave
          It’s up to you to look at both files and determine what modifications, if any, need to be made.

          4.3.2 Querying a Package

          One of the strengths of RPM is that, ideally, it accounts for every system or application file on
          your system. Using RPM’s query mode, you can determine which packages are installed on your
          system or which files belong to a particular package. This can be a big help if you want to locate
          a file that belongs to a certain package. Query mode can also be used to identify which files are in
          an RPM file before you install it. This lets you see the files that are going to be installed on your
          system before they are actually written.
          The -q switch is used to query packages. By itself, -q will give you the version of a specified
          package. If you want to see which version of the tin newsreader you have on your system, you
          would issue the following command:
          # rpm -q tin
          tin-1.22-12
          If you want to see which installed package owns a file, use the -f modifier. Here, we want to see
          which package owns /etc/passwd.
          # rpm -q -f /etc/passwd
          setup-1.9.2-1
          Likewise, if you want to generate a list of files belonging to a certain package, use the -l modifier:

          # rpm -q -l tin
          /usr/bin/rtin
          /usr/bin/tin
          /usr/doc/tin-1.22

          /usr/doc/tin-1.22/CHANGES
          /usr/doc/tin-1.22/FTP
          /usr/doc/tin-1.22/HACKERS
          /usr/doc/tin-1.22/INSTALL
          /usr/doc/tin-1.22/INSTALL.NNTP

          /usr/doc/tin-1.22/MANIFEST
          /usr/doc/tin-1.22/README
          /usr/doc/tin-1.22/TODO
          /usr/man/man1/tin.1

          One of the most common modifiers to -q is -a, query all packages on your system. This system has
          350 packages installed, but here’s a truncated output:
          # rpm -q -a
          setup-1.9.2-1





                                           LOVELY PROFESSIONAL UNIVERSITY                                    73
   75   76   77   78   79   80   81   82   83   84   85