⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0060-0062.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:




<HTML>

<HEAD>

<TITLE>Maximum RPM (RPM):Getting Information About Packages:EarthWeb Inc.-</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311054 //-->

<!-- TITLE=Maximum RPM (RPM)//-->

<!-- AUTHOR=Edward Bailey//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=05 //-->

<!-- PAGES=0053-0078 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->









<P><CENTER>

<a href="0057-0059.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0063-0065.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-60"><P>Page 60</P></A>







<P>that provide low-level structure for a Linux distribution. Let's see what installed packages

make up the Base group:

</P>

<!-- CODE //-->

<PRE>

# rpm -qg Base

setup-1.5-1

pamconfig-0.50-5

filesystem-1.2-1

crontabs-1.3-1

dev-2.3-1

etcskel-1.1-1

initscripts-2.73-1

mailcap-1.0-3

pam-0.50-17

passwd-0.50-2

redhat-release-4.0-1

rootfiles-1.3-1

termcap-9.12.6-5

#

</PRE>

<!-- END CODE //-->



<P>One thing to keep in mind is that group specifications

are case sensitive. Issuing the command rpm -qg

base won't produce any output.

</P>



<B>

5.2.1.6. --whatprovides &lt;x&gt;: Query the Packages That Provide Capability

&lt;x&gt;

</B>



<P>RPM provides extensive support for dependencies between packages. Basically, a package

might require what another package provides. The thing that is

required and provided can be a shared library's soname (which is used to determine compatibility between different versions of

the library). It can also be a character string chosen by the package builder. In any case, it's

important to be able to display which packages provide

a given capability.

</P>



<P>This is just what the --whatprovides option does. When the option, followed by a

capability, is added to a query command, RPM will select the packages that provide the capability.

Here's an example:

</P>

<!-- CODE SNIP //-->

<PRE>

# rpm -q --whatprovides module-info

kernel-2.0.18-5

#

</PRE>

<!-- END CODE SNIP //-->



<P>In this case, the only package that provides the

module-info capability is kernel-2.0.18-5.

</P>



<B>

5.2.1.7. --whatrequires &lt;x&gt;: Query the Packages That Require Capability

&lt;x&gt;

</B>



<P>The --whatrequires option is the logical complement to the

--whatprovides option described earlier. It is used to display which packages require the specified capability. Expanding on

the example we started with --whatprovides, let's see which packages require the

module-info capability:

</P>

<!-- CODE SNIP //-->

<PRE>

# rpm -q --whatrequires module-info

kernelcfg-0.3-2

#

</PRE>

<!-- END CODE SNIP //-->



<P>There's only one package that requires

module-info: kernelcfg-0.3-2.

</P>



<A NAME="PAGENUM-61"><P>Page 61</P></A>







<H4><A NAME="ch05_ 5">

5.2.2. Querying Commands, Part II: Information Selection

</A></H4>



<P>After specifying the package (or packages) you wish to query, you'll need to figure out just

what information you'd like RPM to retrieve. As you've seen, by default RPM only returns the

complete package label. But there's much more to a package than that. Here, we'll explore

every information selection option available.

</P>



<B>

5.2.2.1. -i: Display Package Information

</B>



<P>Adding -i to rpm -q tells RPM to give you some information on the package

or packages you've selected. For the sake of clarity, let's take a look at what it gives you and explain what

you're looking at:

</P>



<!-- CODE //-->

<PRE>

# rpm -qi rpm

Name        : rpm                       Distribution: Red Hat Linux Vanderbilt

Version     : 2.3                             Vendor: Red Hat Software

Release     : 1                           Build Date: Tue Dec 24 09:07:59 1996

Install date: Thu Dec 26 23:01:51 1996    Build Host: porky.redhat.com

Group       : Utilities/System            Source RPM: rpm-2.3-1.src.rpm

Size        : 631157

Summary     : Red Hat Package Manager

Description :

RPM is a powerful package manager, which can be used to build, install, query,

verify, update, and uninstall individual software packages. A package

consists of an archive of files, and package information, including name,

version, and description.

#

</PRE>

<!-- END CODE //-->



<P>There's quite a bit of information here, so let's go through it entry by entry:

</P>



<UL>

<LI>     Name&#151;The name of the package you queried. Usually (but not always) it bears

some resemblance to the name of the underlying software.

<LI>

Version&#151; The version number of the software, as specified by the software's

original creator.

<LI>

Release&#151;The number of times a package consisting of this software has been

packaged. If the version number should change, the release number should start over again at 1.

</UL>



<P>As you've probably noticed, these three pieces of information comprise the package label

we've come to know and love. Continuing, we have these:

</P>



<UL>

<LI>     Install

date&#151;This is the time when the package was installed on your system.

<LI>     Group&#151;In our example, this looks suspiciously like a path. If you went

searching madly for a directory tree by that name, you'd come up dry&#151;it isn't a set of

directories at all.

<P>          When a package builder starts to create a new package, he enters a list of words

that describe the software. The list, which goes from least specific to most specific,

attempts to categorize the software in a concise manner. The primary use for the

group is to enable graphically oriented package managers based on RPM to present

packages grouped by function. Red Hat Linux's

glint command does this.

</P></UL>





<A NAME="PAGENUM-62"><P>Page 62</P></A>



<UL>



<LI>     Size&#151;This is the size (in bytes) of every file in this package. It might make

your decision to erase an unused package easier if you see six or more digits here.

<LI>Summary&#151;This is a concise description of the packaged software.

<LI>Description&#151;This is a verbose description of the packaged software. Some

descriptions might be more, well, descriptive than others, but hopefully it will be enough

to clue you in as to the software's role in the greater scheme of things.

<LI>Distribution&#151;The word Distribution is really not the best name for this

field. Product might be a better choice. In any case, this is the name of the product

this package is a part of.

<LI>     Vendor&#151;The organization responsible for building this package.

<LI>     Build

Date&#151;The time the package was created.

<LI>     Build

Host&#151;The name of the computer system that built the package. Note

to software packagers: Choose your build machine names wisely! A silly or

offensive name might be embarrassing.

<LI>     Source

RPM&#151;The process of building a package results in two files:

<UL>

<LI>     The package file used to install the packaged software. This is sometimes

called the binary package.

<LI>     The

package file containing the source code and other files used to create

the binary package file. This is known as the source RPM package

file. This is the filename that is displayed in this field.

<P>                    Unless you want to make changes to the software, you probably won't need

to worry about source packages. But if you do, stick around because the

second part of this book is for you.

</P></UL></UL>







<B>

5.2.2.2. -l: Display the Package's File List

</B>



<P>Adding -l to rpm -q tells RPM to display the list of files

that are installed by the specified package or packages. If you've used

ls before, you won't be surprised by RPM's file list.

</P>



<P>Here's a look at one of the smaller packages on Red Hat

Linux&#151;adduser:

</P>

<!-- CODE SNIP //-->

<PRE>

# rpm -ql adduser

/usr/sbin/adduser

#

</PRE>

<!-- END CODE SNIP //-->



<P>The adduser package consists of only one file, so there's only one filename displayed.

</P>



<B>

5.2.2.3. -v: Display Additional Information

</B>



<P>In some cases, the -v option can be added to a query command for additional

information. The -l option we've been discussing is an example of just such a case. Note how the

-v option adds verbosity:

</P>



<P><CENTER>

<a href="0057-0059.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0063-0065.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -