In a Linux operating system, there is a system software package, which features similar to "add and delete programs" in Windows, but features much better than "add and delete programs, it is RedHatPackageManager (RPM ). In a Linux operating system, there is a system software package, which functions similar to "add/delete programs" in Windows, but is much more powerful than "add/delete programs, it is Red Hat Package Manager (RPM ). This toolkit was first launched by Red Hat and later borrowed by other Linux developers. Because it saves Linux users a lot of time, it is widely used to install and delete software in Linux. The following describes how to use it.
1. we get a new software, before installation, usually first check what content in this package, assuming the file is: Linux-1.4-6.i368.rpm, we can use this command to view:
Rpm-qpi Linux-1.4-6.i368.rpm
The system will list detailed information about the software package, including the number of files, file names, file size, creation time, and compilation date.
2. all the files listed above are not necessarily installed at the time of installation, just as the installation methods of Windows programs are classified into typical, complete, and custom. Linux also allows you to choose the installation method, in this case, we can use the following command to check which parts of the software package will be installed in the system to facilitate our selection:
Rpm-qpl Linux-1.4-6.i368.rpm
3. select the installation method and start installation. We can install this software with the rpm-ivh Linux-1.4-6.i368.rpm command. During the installation process, if the system prompts that the software has been installed or cannot be installed for other reasons, but if we really want to execute the installation command, you can add the parameter "-replacepkgs" after-ivh ":
Rpm-ivh-replacepkgs Linux-1.4-6.i368.rpm
4. sometimes we only need to execute rpm-e to uninstall a software installed. <文件名> Command.
5. upgrading a lower version of the software is a good way to improve its functions. This saves us the trouble of installing new software after uninstalling it. to upgrade a software, you only need to execute the following command: rpm-uvh <文件名> Note: At this time, the file name must be the upgrade patch for the software to be upgraded?
6. another method for installing software is Linux's unique feature. it is also a manifestation of RMP's powerful functionality: directly installing software online through FTP sites. When you find a site that contains the software you need and connect to this site, execute the following command to achieve online installation, such as online installation of Linux-1.4-6.i368.rpm, you can use the command:
7. when we use computers, we will inevitably encounter misoperations. if we accidentally delete a few files and affect the system performance, how can we find out which files are missing? The RPM package provides a function to find corrupted files. run this command: rpm-Va. Linux will list all corrupted files for you. You can fix the issue through the Linux installation CD.
8. in Linux, there are many files, which we will inevitably encounter when using. in Windows, we can use the "start/search" menu to quickly determine which folder a file belongs, in Linux, the following command line can help us quickly determine which software package a file belongs:
Rpm-qf <文件名>
9. after each software package is installed in Linux, the installation file is "reported" in the RPM Database. Therefore, when we want to query the attributes of an installed software, you only need to search for the database. Note: the query command is different from the query commands described in 1 and 8. this method is only applicable to installed software packages! Command format:
Rpm-parameters <文件名>
In Linux, almost all software is installed, uninstalled, and managed through RPM. RPM is called Redhat Package Manager. it is a software developed by Redhat to manage software packages in Linux. During Linux installation, almost all modules except several core modules are installed through RPM. RPM has five operation modes: installation, uninstallation, upgrade, query, and verification.
RPM installation
Command:
File name of the rpm-I package to be installed
Example:
Rpm-I example. rpm install the example. rpm package;
Rpm-iv example. rpm install the example. rpm Package and display the file information that is being installed during the installation process;
Run rpm-ivh example. rpm to install the example. rpm Package and display the information about the files being installed and the installation progress;
RPM query operation
Command:
Rpm-q...
Additional query command:
A. query all installed packages. the following two additional commands are used to query the information of the installation package;
I. The information of the installation package is displayed;
L displays the directories to which all files in the installation package are installed;
S displays the status of all the files in the installation version and the directories to which the files are installed. the following two additional commands are used to specify whether the installation package or the files have been installed;
P queries information about the installation package;
F query information about a file that has been installed;
Example:
Rpm-qa | grep tomcat4 check whether tomcat4 is installed;
Run rpm-qip example. rpm to view the information of the example. rpm installation package;
Run rpm-qif/bin/df to view the information of the installation package where the/bin/df file is located;
Run rpm-qlf/bin/df to check which Directory the files in the installation package where the/bin/df file is located are installed;
RPM uninstall operation
Command:
Installation package to be uninstalled by rpm-e
Before uninstalling, you usually need to use rpm-q... Command to find the name of the installation package to be uninstalled.
Example:
Rpm-e tomcat4 uninstall the tomcat4 software package
RPM upgrade operation
Command:
Rpm-U package to be upgraded
Example:
Rpm-Uvh example. rpm upgrade example. rpm Package
RPM verification operation
Command:
Rpm-V package to be verified
Example:
Rpm-Vf/etc/tomcat4/tomcat4.conf
The output information is similar to the following:
S.5..... T c/etc/tomcat4/tomcat4.conf
S indicates that the file size has been modified, and T indicates that the file date has been modified. For more verification information, see The rpm help file man rpm.
Additional RPM commands
-- Force operations such as force installation and deletion;
-- Requires: displays the dependency of the package;
-- Nodeps ignores dependencies and continues operations
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.