Detailed explanation of RPM command parameters in Linux

  
                  

In the Linux operating system, there is a system package that functions like "Add/Remove Programs" in Windows, but the function is much stronger than "Add/Remove Programs", it is Red. Hat Package Manager (RPM). This toolkit was first introduced by Red Hat and later borrowed from other Linux developers. Because it saves a lot of time for Linux users, it is widely used to install and remove software under Linux. Let me introduce you to its specific use.

1. We get a new software. Before installing, we should first check what is in this package. Suppose the file is: Linux-1.4-6.i368.rpm, we can use This command is viewed:

rpm -qpi Linux-1.4-6.i368.rpm

The system will list the details of this package, including how many files and file names. , file size, creation time, compilation date, and more.

2. All the files listed above may not be installed at the time of installation. Just like the installation method of Windows is divided into typical, complete and customized, Linux will let you choose the installation method. We can use the following command to see which parts of the package will be installed in the system to facilitate our choice:

rpm -qpl Linux-1.4-6.i368.rpm

3. After selecting the installation method, start the 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, we can add a parameter after -ivh“-replacepkgs”:

Rpm -ivh -replacepkgs Linux-1.4-6.i368.rpm

4. Sometimes we uninstall an installed software by executing the rpm-e <filename> command.

5. Upgrading the lower version of the software is a good way to improve its functionality. This saves us the trouble of installing new software after uninstalling. To upgrade a software, just execute the following command: rpm - Uvh <file name>, note: the file name must be an upgrade patch to upgrade the software.

6. Another way to install the software is Linux's unique, but also RMP powerful A manifestation of functionality: install software directly online via an FTP site. Once you find the site that contains the software you need and connect to it, you can perform the online installation by executing the following command, such as installing Linux-1.4-6.i368.rpm online, you can use the command:

rpm -i ftp://ftp.pht.com/pub/linux/redhat/rpms/Linux-1.4-6.i368.rpm

7. In the process of using the computer, it is inevitable that there will be misoperations. If we accidentally delete a few files and affect the performance of the system, how to find out which files are missing? RPM package provides a function to find damaged files, execute this command: rpm -Va, Linux will be You list all the damaged files. You can fix it through the Linux installation CD.

8. There are many files in the Linux system. In the process of use, it is inevitable that we will encounter files that we don't know. Under Windows, we can use the “Start/Find” menu to quickly determine which file belongs to. Folders, in Linux, the following command line can help us quickly determine which package a file belongs to:

rpm -qf <filename>

9.When each After installing the software package on the Linux system, the installation files will go to the RPM database and report to the RPM database. Therefore, when we want to query the properties of an installed software, we only need to find it in this database. Note: The query command at this time is different from the query described in 1 and 8. This method only works for packages that have already been installed! Command format:

rpm -parameter <filename>

Copyright © Windows knowledge All Rights Reserved