Original Address: http://bbs.51cto.com/topic/thread-700076.html
1 What is the rpm?
rpm the RedHat Package Management, is the invention of one of the RedHat
2 Why do I need rpm?
In an operating system, the need to install software packages to achieve various functions. These packages generally have their own procedures,
But also have complex dependencies. Also need to address the package version, as well as installation, configuration,
Unloading automation problems. To address these issues, RedHat system for their own proposed a better approach
To manage hundreds of software. This is the RPM management system. In the system after installing the rpm management system,
Rpm file as long as they meet the standard packaged programs can be easily install, upgrade, uninstall.
[Align = left] 3. Is not all linux use rpm? [/ Align] Any system needs to package management system, so a lot of [url = http://jiaogen.com/] [color = black] linux [/ color] [/ url] use the rpm system. rpm and the system is Redhat Linux
Fedora Core package manager, but Mandriva, SuSE and other Linux distributions use rpm. As rpm
The source code can be compiled on other systems, so there may be other systems also use rpm. In addition rpm,
Other systems also have their own package manager, such as the debian deb package.
[Align = left] 4.rpm package file name Why so long? [/ Align] rpm package file name contains the package version information, operating system information, hardware requirements, etc.
For example mypackage-1.1-2RH.i386.rpm, which mypackage is registered in the system the name of the package 1.1
The software version number, issue number 2, RH RH operating system that is used. i386 said for intel x86 platform.
[Align = left] 5. A package file name in the i386, i686 mean [/ align] rpm package file name, not only includes the software name, version information, including the hardware architecture of the applicable information.
i386 refers to the package for intel 80386 more than the x86 architecture computer (AI32)
i686 refers to the package for intel 80686 or more (Pentium pro and above) of the x86 architecture computer (IA32)
noarch means the package has nothing to do with the hardware architecture, can be common.
i686 packages are usually optimized for the CPU, the configuration of the machines are now usually use i686 packages.
[Align = left] 6. Different operating system can issue the rpm package mix? [/ Align] to have been compiled into a binary rpm package, because the operating system environment is different, generally can not be mixed.
For src.rpm release package, because when you need to install locally compiled, it can usually be installed in different systems.
[B] two, RPM package management uses [/ b]
1, you can install, remove, upgrade and management of the rpm package distributed as software;
2, one can check which rpm package contains the files, and specify the files belong to which a rpm package;
3, you can query the system in a rpm package is installed and its version;
4, as developers can develop their own software packages labeled rpm release;
5, the dependence of the inspection, check to install a rpm package, you need what the other rpm package.
NOTE: RPM software installation, delete, update only to be root to use;
For any user can query feature operation.
[B] three, rpm's a little simple usage [/ b]
[Align = left] rpm of the general format: [/ align] rpm [options] [rpm package]
[Align = left] 1, initialize the rpm database (can be omitted) [/ align] rpm - initdb
rpm - rebuilddb% Note: This takes a long time
% Note: Sometimes the rpm system is a problem, can not be installed and queries, mostly a problem here.
[Align = left] 2, RPM package management query function: [/ align] rpm-q [select-options] [query-options]
[Align = left] RPM's query function is very powerful, it is extremely important features; here a few common examples of more specific detail, refer to man rpm [/ align] [align = left] [ i] software has been installed on the system, the query [/ i] [/ align] 1) the query system has been installed software
Syntax: rpm-q Software Name
Example: rpm-q mplayer
%-Q is - query, this option means your system is not installed gaim package;
% If you have installed will have the information output; If not, will not install gaim output of information;
% View the system has been installed in all packages, to add the-a parameter
% If the page view, plus a pipe | and more command
rpm-qa | more
% If you want to find a package, can be extracted with grep
rpm-qa | grep mplayer
2) query an already-installed files belong to which package;
Syntax: rpm-qf filename
Note: the file name where the absolute path to that
Example: rpm-qf / usr / lib / libacl.la
3) query the installed packages are installed where they are;
Syntax: rpm-ql package names
Example: rpm-ql mplayer
4) query an installed package information
Syntax: rpm-qi package names
Example: rpm-qi mplayer
5) look at the installed software configuration files;
Syntax: rpm-qc Software Name
Example: rpm-qc mplayer
6) Check the documentation that have been installed software installation location:
Syntax: rpm-qd Software Name
Example: rpm-qd mplayer
7) look at the installed software packages rely on and documents;
Syntax: rpm-qR Software Name
Example: rpm-qR mplayer
[B] Note [/ b]: Several parameters can be combined with, such as rpm-qil mplayer
[Align = left] [i] is not installed package for viewing [/ i]: View the premise that the current directory already exists. Rpm files. [/ Align] 1) view the use of a software package, version and other information;
Syntax: rpm-qpi file.rpm
Example: rpm-qpi mplayer-1.0pre7try2-2.i386.rpm
2) Check the package contains a file;
Syntax: rpm-qpl file.rpm
Example: rpm-qpl mplayer-1.0pre7try2-2.i386.rpm
3) Check the location of the document package;
Syntax: rpm-qpd file.rpm
Example: rpm-qpd mplayer-1.0pre7try2-2.i386.rpm
4) View a package's configuration file;
Syntax: rpm-qpc file.rpm
Example: rpm-qpc mplayer-1.0pre7try2-2.i386.rpm
5) Check dependencies of a package
Syntax: rpm-qpR file.rpm
Example: rpm-qpR mplayer-1.0pre7try2-2.i386.rpm
[Align = left] 3, the package installation, upgrade, delete, etc.; [i] to install and upgrade a rpm package [/ i] [/ align] syntax:
rpm-ivh file.rpm% This is used to install a new rpm package
rpm-Uvh file.rpm% This is used to upgrade a rpm package
% If there is dependency, the need to resolve dependencies.
% If you can not find the dependencies of the package, you can use the following command to force the installation:
rpm-ivh - nodeps - force file.rpm
rpm-Uvh - nodeps - force file.rpm
rpm-ivh - test mplayer-1.0pre7try2-2.i386.rpm
% - Test that the test does not really install.
rpm-ivh - relocate / = / usr / local / mplayer mplayer-1.0pre7try2-2.i386.rpm
% Specify the installation directory for the package: to add - relocate parameter
% Installed in the specified directory in the program how to call it?
%, Usually executable programs are placed in the bin under the installation directory or sbin directory.
[Align = left] [i] remove a rpm package [/ i] [/ align] first identified the need to remove the rpm package, then use the following command to uninstall:
rpm-e package names
Example: rpm-e mplayer% uninstall mplayer
% If there are other rpm depending on the rpm package, the system will be a warning.
% If you have to uninstall, you can use the option - nodeps ignore dependencies. But best not to do so.
[B] four, RPM Package Manager to support management and query network installation [/ b]
rpm [options] rpm package http or ftp address
For example, we want to Fedora Core 4.0, a query image, the installation package.
rpm-qpi [url] http://mirrors.kernel.org/.../RPMS/rsh-0.17-29.rpm [/ url]
rpm-ivh [url] http://mirrors.kernel.org/.../RPMS/rsh-0.17-29.rpm [/ url]
[B] five, have been installed [url = http://linuxrpminstall.jiaogen.com/] [color = black] linux rpm [/ color] [/ url] bag check point to add [/ b]
Use locate to check some of the software is installed, you may need to run updatedb to update the installed software library
[B] six, extract files from rpm package [/ b]
rpm2cpio xxx.rpm | cpio-idmv
% I extract that file, v indicates that the process of implementation
% D said that according to the original package file to create the directory path
% M that keep the file updated