linux-rpm command management (query, checksum file management)

   There is no query method for yum. So if you want to query, you can only use rpm, no matter what command is installed, you can use the rpm command to query

1. Inquire whether to install:

                   rpm -q package name (-q means query, query whether the package is installed;)

                   rpm -qa (a means all, query all installed RPM packages)

                   

                 rpm -qa | grep httpd (use the pipe character to check to find out all package names containing httpd)

                  

2: Query software package details:

                 rpm -qi package name (-i (information means to query software information) -p (package means to query information about uninstalled packages, note that the following package must be the full name of the package))

               

3. Query the file installation location in the package:

               rpm -ql package name (-l (indicating list) (-p query information about uninstalled packages, because the installation location of the files under the general package has been designed when the component package)          

              

4. Query which RPM package the system file belongs to

              rpm -qf system file name. (-F (Query which file system file belongs to)) You can try using the file name in the etc directory, because the system files are installed in the / etc directory

               

 

5. Query package dependencies

              rpm -qR package name (-R (query package dependencies))

6. RPM packet verification

            The significance of verification is to let us discover whether our system files have been modified

            rpm -V package name (check if the package name is modified)

             

          

          

7. File extraction in RPM package

                The full name of the rpm2cpio package | \ (\ indicates that a command has not been lost, and a line feed)

               cpio -idv. absolute file path (. means to extract the specified file to the current path)

                rpm2cpio represents the command to convert the rpm package to cpio format. cpio is a standard tool that is used to create software archive files and extract files from archive files

               cpio option <file | device>

              Option -i: copy-in mode, restore -d: automatically create a new directory when restoring, -v: show the restoration process

            Example: rpm2cpio /mnt/cdrom/Packages/coreutils-8.4-19.el6.i686.rpm | cpio -idv ./bin/ls

            

          The dir command displays a list of directory files and subdirectories

Published 148 original articles · Like 10 · Visitors 20,000+

Guess you like

Origin blog.csdn.net/ab1605014317/article/details/104868922