Using Linux:Managing Applications
-->
Previous
Table of Contents
Next
This means that the package xdosemu does not function properly if the package dosemu is removed. If you still want to remove this package, rpm could be presented with the --nodeps option to make it ignore dependency errors.
The other useful option is the --test option, which causes rpm to go through the motions of removing a package without actually removing anything. Usually there is no output from an uninstall, so the -vv option is presented along with the --test option to see what would happen during an uninstall:
# rpm -e -vv --test xdosemu
This example produces the following output on the system:
D: counting packages to uninstall
D: opening database in //var/lib/rpm/
D: found 1 packages to uninstall
D: uninstalling record number 1650520
D: running preuninstall script (if any)
D: would remove files test = 1
D: /usr/man/man1/xtermdos.1 - would remove
D: /usr/man/man1/xdos.1 - would remove
D: /usr/bin/xtermdos - would remove
D: /usr/bin/xdos - would remove
D: /usr/X11R6/lib/X11/fonts/misc/vga.pcf - would remove
D: running postuninstall script (if any)
D: script found - running from file /tmp/02695aaa
+ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
+ export PATH
+ [ -x /usr/X11R6/bin/mkfontdir ]
+ cd /usr/X11R6/lib/X11/fonts/misc
+ /usr/X11R6/bin/mkfontdir
D: would remove database entry
As you can see, the files that would have been removed are clearly indicated in the output.
Querying Packages
The querying mode in rpm allows for determining the various attributes of packages. The basic syntax for querying packages is as follows:
rpm -q [options] [packages]
options is one or more of the query options listed later in this section. The most basic query is one similar to the following:
# rpm -q kernel
On my system, this prints out the following line for the kernel package:
kernel-2.0.27-5
In a manner similar to uninstall, rpms query mode uses the name of the package, not the name of the file that the package came in for queries.
Now for a few more sample queries. If you want to retrieve a list of all the files owned by the kernel package, you can use the -l option:
# rpm -ql kernel
This outputs the following list of files on my system:
/boot/System.map-2.0.27
/boot/module-info
/boot/vmlinuz-2.0.27
In addition to getting a list of the files, you can determine their state by using the -s option:
# rpm -qs kernel
This option gives the following information about the state of files in my kernel package:
normal /boot/System.map-2.0.27
normal /boot/module-infonormal /boot/vmlinuz-2.0.27
If any of these files reported a state of missing, there are probably problems with the package.
In addition to the state of the files in a package, the documentation files and the configuration files can be listed. To list the documentation that comes with the dosemu package, use the following:
# rpm -qd dosemu
This produces the following list:
/usr/man/man1/dos.1
To get the configuration files for the same package, use the following query:
# rpm -qc dosemu
This results in the following list:
/etc/dosemu.conf
/var/lib/dosemu/hdimage
In addition to these queries, complete information about a package can be determined by using the info option:
# rpm -qi kernel
This example gives the following information about the installed kernel package:
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.
A summary of the query options appears in Table 30.2.
TABLE 30.2 Summary of rpms query options
Option
Description
-a
Lists all installed packages
-c
Lists all files in a package that are marked as configuration
-d
Lists all files in a package that are marked as documentation
-f file
Lists the package that owns the specified file
-i
Lists the complete information for a package
-l
Lists all the files in a package
-p package
Lists the package name of the specified package
-s
Lists the state of files in a package
If any of these options, except for -i, are given along with a -v option, then the files are listed in ls -l format:
# rpm -qlv kernel
This example outputs the following:
-rw-rr--- root root 104367 Dec 21 21:05 /boot/System.map-2.0.27
-rw-rr--- root root 11773 Dec 21 21:05 /boot/module-info
-rw-rr--- root root 449760 Dec 21 21:05 /boot/vmlinuz-2.0.27
Verifying Packages
Verifying packages is an easy way to determine whether 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.
The basic syntax for verifying a package is as follows:
rpm -V [package]
Previous
Table of Contents
Next
Wyszukiwarka
Podobne podstrony:
11 (528)2006 praktyczny czerwiecid 524528 (2)readme (528)524,6,artykulRouter bezprzewodowy D Link DI 524 AirPlus G High Speed 2 4GHzII CSK 528 06 1I PKN 528 99528,15,artykul528 533522 528avt 524 Programator USB mikrokontrolerów ATmega ISPwięcej podobnych podstron