0312-0316.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 520 行
HTML
520 行
<HTML>
<HEAD>
<TITLE>Developer.com - Online Reference Library - 0672311739:RED HAT LINUX 2ND EDITION:Getting Started with Red Hat Linux</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=0672311739 //-->
<!-- TITLE=RED HAT LINUX 2ND EDITION //-->
<!-- AUTHOR=DAVID PITTS ET AL //-->
<!-- PUBLISHER=MACMILLAN //-->
<!-- IMPRINT=SAMS PUBLISHING //-->
<!-- PUBLICATION DATE=1998 //-->
<!-- CHAPTER=14 //-->
<!-- PAGES=0299-0318 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0309-0311.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0317-0318.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-312"><P>Page 312</P></A>
<P>In addition to these queries, complete information about a package can be determined by
using the info option. For example,
</P>
<!-- CODE SNIP //-->
<PRE>
rpm -qi kernel
</PRE>
<!-- END CODE SNIP //-->
<P>gives the following information about the installed kernel package:
</P>
<!-- CODE //-->
<PRE>
Name : kernel Distribution: Red Hat Linux Vanderbilt
Version : 2.0.27 Vendor: Red Hat Software
Release : 5 Build Date: Sat Dec 21 21:06:28 1996
Install date: Thu Jul 17 14:10:52 1997 Build Host: porky.redhat.com
Group : Base/Kernel Source RPM: kernel-2.0.27-5.src.rpm
Size : 565900
Summary : Generic linux kernel
Description : This package contains the Linux kernel that is
Âused to boot and run your system. It contains few device
Âdrivers for specific hardware. Most hardware is instead
Âsupported by modules loaded after booting.
</PRE>
<!-- END CODE //-->
<P>Here is a summary of the query options:</P>
<TABLE WIDTH="360">
<TR><TD>
-l
</TD><TD>
Lists all the files in a package
</TD></TR>
<TR><TD>
-s
</TD><TD>
Lists the state of files in a package
</TD></TR>
<TR><TD>
-d
</TD><TD>
Lists all files in a package that are marked as documentation
</TD></TR>
<TR><TD>
-c
</TD><TD>
Lists all files in a package that are marked as configuration
</TD></TR>
<TR><TD>
-i
</TD><TD>
Lists the complete information for a package
</TD></TR>
</TABLE>
<P>If any of these options, except for -i, are given along with a
-v option, then the files are listed in ls -l format. For example,
</P>
<!-- CODE SNIP //-->
<PRE>
rpm -qlv kernel
</PRE>
<!-- END CODE SNIP //-->
<P>outputs the following:
</P>
<!-- CODE //-->
<PRE>
-rw-r--r--- root root 104367 Dec 21 21:05 /boot/System.map-2.0.27
-rw-r--r--- root root 11773 Dec 21 21:05 /boot/module-info
-rw-r--r--- root root 449760 Dec 21 21:05 /boot/vmlinuz-2.0.27
</PRE>
<!-- END CODE //-->
<P>In addition to the preceding query options, RPM also understands the following query <BR>
options:
</P>
<TABLE WIDTH="360">
<TR><TD>
-a
</TD><TD>
Lists all installed packages
</TD></TR>
<TR><TD>
-f file
</TD><TD>
Lists the package that owns the specified file
</TD></TR>
<TR><TD>
-p package
</TD><TD>
Lists the package name of the specified package
</TD></TR>
</TABLE>
<A NAME="PAGENUM-313"><P>Page 313</P></A>
<H4><A NAME="ch14_ 16">
Verifying Packages
</A></H4>
<P>Verifying packages is an easy way to determine if there are any problems with an
installation. In verification mode, RPM compares information about an installed package against
information about the original package, which is stored in the package database at install time.
</P>
<P>The basic syntax for verifying a package is as follows:
</P>
<!-- CODE SNIP //-->
<PRE>
rpm -V [package]
</PRE>
<!-- END CODE SNIP //-->
<P>If a package is verified correctly, RPM will not output anything. If RPM detects a
difference between the installed package and the database record, it outputs an 8-character string,
where tests that fail are represented by a single character and tests that pass are represented by a
period (.). The characters for failed tests are as follows:
</P>
<TABLE WIDTH="360">
<TR><TD>
<B>Character</B>
</TD><TD>
<B>Failed Test</B>
</TD></TR>
<TR><TD>
5
</TD><TD>
MD5 Sum
</TD></TR>
<TR><TD>
S
</TD><TD>
File Size
</TD></TR>
<TR><TD>
L
</TD><TD>
Symlink
</TD></TR>
<TR><TD>
T
</TD><TD>
Mtime
</TD></TR>
<TR><TD>
D
</TD><TD>
Device
</TD></TR>
<TR><TD>
U
</TD><TD>
User
</TD></TR>
<TR><TD>
G
</TD><TD>
Group
</TD></TR>
<TR><TD>
M
</TD><TD>
Mode (permissions and file type)
</TD></TR>
</TABLE>
<P>For example, on my system, verifying the bash package using
</P>
<!-- CODE SNIP //-->
<PRE>
rpm -V bash
</PRE>
<!-- END CODE SNIP //-->
<P>fails as follows:
</P>
<!-- CODE SNIP //-->
<PRE>
.M..L... /bin/bash
....L... /bin/sh
</PRE>
<!-- END CODE SNIP //-->
<P>This indicates that the size of my bash is different from the information stored in the
database. This is okay on my system because I have recompiled
bash.
</P>
<P>In addition it is possible to use the query option
-f to verify a package containing a particular file, which is helpful when diagnosing problems with programs. For example, if
ksh were behaving peculiarly,
</P>
<!-- CODE SNIP //-->
<PRE>
rpm -Vf /bin/ksh
</PRE>
<!-- END CODE SNIP //-->
<P>would verify the package that ksh came in. If any of the tests fail, you will be closer to
understanding the source of the problems.
</P>
<A NAME="PAGENUM-314"><P>Page 314</P></A>
<H4><A NAME="ch14_ 17">
Introduction to glint
</A></H4>
<P>The most common way most users interact with RPM is via
glint, the graphical Linux installation tool.
glint is an X-based interface for RPM that allows for installing, uninstalling,
querying, and verifying packages via a graphical "File Manager" interface.
</P>
<P>glint is accessible from the command line or the Control Panel application that comes
with Red Hat Linux. To launch glint, simply type
</P>
<!-- CODE SNIP //-->
<PRE>
glint
</PRE>
<!-- END CODE SNIP //-->
<P>at the prompt. glint accepts no command-line options. When
glint is loading, a message such as
</P>
<!-- CODE SNIP //-->
<PRE>
Glint Graphical Package Manager -- version 2.1.5 Copyright (d) 1996
ÂRed Hat Software
ÂThis may be freely redistributed under the terms of the GNU Public License
</PRE>
<!-- END CODE SNIP //-->
<P>will appear in the terminal window. After glint has loaded, a window similar to Figure
14.1 will appear.
</P>
<BR>
Figure 14.1.<BR>
The primary<BR>
glint window.<BR>
<a href="12rhu01.html"><img src="images/tn_12rhu01_jpg.jpg"></a><BR>
<P>From this window, different packages can be selected and queried, verified, uninstalled,
or installed. When you click the Available button, all packages available for installation from
the default location (/mnt/cdrom/RedHat/RPMS) will be listed in the Available Packages window,
as shown in Figure 14.2.
</P>
<A NAME="PAGENUM-315"><P>Page 315</P></A>
<BR>
Figure 14.2.<BR>
The Available Packages<BR>
glint window.<BR>
<a href="12rhu02.html"><img src="images/tn_12rhu02_jpg.jpg"></a><BR>
<P>By navigating through the folders, you can select and install different packages. As an
example, let's take a look at installing the vim package.
</P>
<P>To install the vim package, first launch glint; then in the Installed Packages window, click
the Available button. When the Available Packages window appears, select the Applications
folder and then the Editors folder. Then, click the package
vim-4.5-2, which becomes highlighted (see Figure 14.3).
</P>
<BR>
Figure 14.3.<BR>
Available Packages<BR>
with vim selected.<BR>
<a href="12rhu03.html"><img src="images/tn_12rhu03_jpg.jpg"></a><BR>
<A NAME="PAGENUM-316"><P>Page 316</P></A>
<P>When a package is highlighted, it can be installed by clicking the Install button. You can
install many packages at once by highlighting more than one package.
</P>
<P>When you click the Install button, the Installing dialog box appears (see Figure 14.4).
This dialog shows the progress of the installation.
</P>
<BR>
Figure 14.4.<BR>
The Installing dialog.<BR>
<a href="12rhu04.html"><img src="images/tn_12rhu04_jpg.jpg"></a><BR>
<P>When vim has been installed, it will be removed from the Available Packages window.
</P>
<P>In this example, I assumed that the available packages were stored in the default location
mentioned earlier. Often that is not the case. You can change this location by first clicking
the Configure button in the primary glint window (refer to Figure 14.1). Then, enter the
different location where the package files are located in the Configuration dialog that appears
(see Figure 14.5).
</P>
<BR>
Figure 14.5.<BR>
Changing the package<BR>
location.<BR>
<a href="12rhu05.html"><img src="images/tn_12rhu05_jpg.jpg"></a><BR>
<P>glint also provides a nice front end for querying packages.
glint executes most of the queries automatically and displays the results in a tabular form. For example, a query of the
vim package looks similar to Figure 14.6.
</P>
<P><CENTER>
<a href="0309-0311.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0317-0318.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?