The use of RPM packets to publish software becomes more popular, mainly because this software release method is convenient for users to install, upgrade, and delete from the system. In addition, RPM can make you more information on the software package for the software installed. For example, what you have installed in the new system, see what files have been installed separately, these files Where is it? Here I give a simple entry manual for beginners to see the reference, quickly use RPM. These rpm commands are the most common, more complex features, you can temporarily don't use the tube, wait for the MAN manual when you do need it.
The generally adopted command format for installing an RPM package is as follows:
# rpm -ivh package.ix86.rpm
In the above command, Package is a hypothetical name, IX86 is the meaning of optimization processing for a particular CPU. For example, Package may be ldconfig-1.9.5-14, while IX86 is i386.
"-I" parameter indicates that this package is to be installed, and "-V" parameters increase the output information, "- H" indicates that HASHES is displayed as a progress bar in the installation process during the installation process.
The above is all about installing an RPM package, very simple and easy to use. Of course, if you encounter some of the problems with some bag dependencies during the installation process, you have to trouble something. The problem of relying on the relationship is that the package you are installing requires the support of other packages to work. It is usually possible to have problems that the installed package needs a certain software or a specific version of the library to work properly. In this case, you can install or upgrade the dependent package, then continue to install the package you need to install.
If you have to watch a RPM package installation, you can use this command:
# rpm -ql packagename This packagename is the name of the package you want to query, such as ldconfig-1.9.5-14mdk; "-p" parameter represents the query package database, see if this package is already installed; "- l" The parameter represents the full path to all installed files of the query package. Here is an example: [WH @ infonet wh] $ rpm -ql ldconfig-1.9.5-14mdk / sbin / ldconfig /usr/doc/ldconfig-1.9.5 /usr/doc/ldconfig-1.9.5/Readme Delete A specific RPM package software. The command parameters used are "-e", the format is as follows: # rpm -e packagename
"-E" means deleting (ERASE) means deleting a specific package (packagename).
It is worth noting that the RPM management mechanism does not allow you to delete a package, if this package is still dependent by other packages. Because once you delete this package, other packages that depend on him can run, can not be used normally.
Upgrade an existing RPM package software. Upgrade is actually similar to the installation, you can refer to the following command:
# rpm -uvh package.ix86.rpm "-u" parameter representation is an upgrade, parameter "V" and "H" meanings, the same, and will not be described here. At this point, we have learned, how to install, delete and upgrade a software that uses RPM released. :) ------------------------------------------------ ---------- RPM has five basic operations (excluding creating packages): Installation, uninstall, upgrade, query, and verification. Let's explain one by one. 1. Installing the RPM package RPM package usually has a file name similar to FOO-1.0-1.i386.rpm. These include the name of the package (foo), version number (1.0), the issuance number (1), and the hardware platform (I386). Installing a package simply typing the following command: $ rpm -ivh foo-1.0-1.i386.rpm foo ####################### ############# The name of the package will be printed after the installation is completed (not necessarily the same as the file name), and then print a series of ## to indicate the installation progress. Although the installation of the package is designed as simple as possible, it is possible to happen: 1. The package has been installed if your package has been installed, will appear: $ rpm -ivh foo- 1.0-1.i386.rpm foo package foo-1.0-1 is already installed error: foo-1.0-1.i386.rpm cannot be installed If you still need to install the package, you can use the --ReplacePKGS option on the command line RPM will ignore the error message forcibly installed. 2, file conflicts If you have a file in the package you want to install, there is a file that is installed when you install other packages, the following error message will appear: # rpm -ivh foo-1.0-1.i386.rpm foo / usr / bin / foo Conflicts with file from bar-1.0-1 error: foo-1.0-1.i386.rpm cannot be installed To allow RPM to ignore the error message, use the --ReplaceFiles command line option. 3, unresolved RPM software package may depend on other packages, that is, the package can be installed after the specific package is installed. If there is such an unresolved dependency when you install a package. The following information is produced: $ rpm -ivh bar-1.0-1.i386.rpm failed dependencies: foo is needed by bar-1.0-1 You must install the redeered package to solve this problem. If you want to force installation (this is a bad idea, because the installed package is not necessarily running normally), use the --Node Pro command line option. Second, uninstalling the RPM package uninstalling the package as simple as installing the package: $ rpm -e foo Note This name Name `foo '' uses the package, not the name of the package file File` ` FOO-1.0-1.i386.rpm ''. If other packages rely on packages you want to uninstall, error messages are generated when uninstalling. Such as: $ rpm -e foo removing the package: foo is needed by bar-1.0-1 If you let RPM ignore this error continues to uninstall (this is not a good idea, because the program depends on the package may not be able to run Please use the --Nodeps command line option.
3. Upgrade RPM package upgrade package and installation package very similar: $ rpm -uvh foo-2.0-1.i386.rpm foo ################ #################### r r 载 载 本 的 本 本 本 本 本 本In fact, you may always use -U to install the package, because even if the package is not installed, you can run it normally. Because RPM performs intelligent packages upgrade, automatically handle the configuration file, you will see the following information: saving /etc/foo.conf as /etc/foo.conf.rpmsave This means that you don't have to modify the configuration file Up is compatible. Therefore, RPM will back up the old file and install new files. You should resolve the differences between these two configuration files as soon as possible so that the system can run normally. Since the upgrade actually includes the uninstall and installation of the package, you may encounter an error caused by these two operations. Another problem that you may encounter is: When you use the old version of the package to upgrade the new version of the software, RPM produces the following error message: $ rpm -uvh foo-1.0-1.i386.rpm foo package foo- 2.0-1 (Which is newer) is already installed error: foo-1.0-1.i386.rpm cannot be installed If you do have the need to downgrade, join the - keldPackage command option. four Query the installed software package use the command rpm -q to query the database installed package. Simple usage command rpm -q foo will print the package name, version number, and issuer of the Foo package: $ rpm -q foo foo-2.0-1 In addition to the specified software package name, you can also use the following options to specify which packages you want to query. These options are called "Software Pack Specified Options". · -a query all The installed package · -f will query the package containing the file. (-P query) package file name can also specify the information displayed when the package is queried. They are called information selection options: · i Display package information, such as description, issue number, size, build date, installation date, platform, and some other information. · -l Displays a list of files in the package. · -s Displays all files in the package State. · -D Displays a list of files labeled as a document (MAN manual, INFO manual, readme's, etc). · -C Displays a list of files labeled as profiles. These are files you want to make after installation. (SendMail.cf, PASSWD, INITTAB, ETC). For files to display file list, you can add the -v command line option to get the output as the LS -L format. 5, verification software package verification software The package is performed by comparing the original file information in the installed file and package. Verification is mainly comparable to the size, MD5 check code, file permissions, type, owner and user group. RPM-V command To verify a package. You can use any package selection option to query the package you want to verify. Command rpm -v foo will be used to verify the Foo package. Another example: · Verify the package containing a specific file: rpm -vf / bin / vi · Verify all installed packages: rpm -va · According to an RPM package: rpm -vp foo-1.0-1.i3 86.rpm If you are worried that your RPM database has been destroyed, you can use this way. If everything is verified, no output will be generated. If there is inconsistent place, it will be displayed. The output format is an 8-bit long string, `` `'' is used to refer to the configuration file, then the file name. 8-bit character's comparison result for indicating a file and the RPM database.