RPM package checksum extraction and RPM package checksum Extraction

Source: Internet
Author: User

RPM package checksum extraction and RPM package checksum Extraction
I. RPM package Verification

[Root @ localhost Packages] #Rpm-V package name already installed

# Options:

#-V verify the file (verify) in the specified RPM package)

[Root @ localhost Packages] #Vim/etc/httpd/conf/httpd. conf---> Modify the package configuration file

[Root @ localhost Packages] #Rpm-V httpd ---> verify the modified package again (no change, no prompt)

S.5... T. c/etc/httpd/conf/httpd. conf

The content of the eight items in the verification content is as follows:

S file size changed

Whether the M file type or File Permission (rwx) Changes

5. Whether the MD5 checksum of the file is changed (whether the file content is changed)

D device master/times code changed

L Link path changed

U file owner has been changed

The group to which the G file belongs has been changed.

T File Creation Time is changed

File Type:

C configuration file)

D. documentation)

G "ghost" file (ghost file) rarely occurs. Generally, this file is not included in the software package.

L license file)

R description file (read me)

Ii. File extraction in the RPM package

[Root @ localhost testuser] #Rpm-qf/usr/bin/ls---> Query the package to which the file belongs

Coreutils-8.22-11.el7.x86_64

[Root @ localhost testuser] #Rpm2cpio/mnt/cdrom/Packages/coreutils-8.22-11.el7.x86_64.rpm | cpio-t | grep/usr/bin/ls

#---> Query the relative path of a file

./Usr/bin/ls

28552 blocks

[Root @ localhost testuser] #Pwd ---> view the current location

/Home/testuser

[Root @ localhost testuser] #Ll---> View files in the current directory

Total 0

[Root @ localhost testuser] #Rpm2cpio/mnt/cdrom/Packages/coreutils-8.22-11.el7.x86_64.rpm | cpio-idv./usr/bin/ls

#---> Extract the required files from the package to the current directory.

./Usr/bin/ls

28552 blocks

[Root @ localhost testuser] #Ll ---> check whether the current directory is extracted successfully

Total 0

Drwxr-xr-x. 3 root 16 Mar 2 09:19Usr---> This directory appears, indicating that the file has been extracted successfully.

[Root @ localhost testuser] #Cd usr/bin/---> Enter the Directory

[Root @ localhost bin] #Ll---> Check whether the specified extracted files exist in the directory.

Total 116

-Rwxr-xr-x. 1 root 117616 Mar 2Ls---> The specified file is extracted successfully.

 

# After extracting the files to be restored, copy the files to the corresponding directory.

[Note] the file path after the cpio parameter"./Usr/bin/ls"It must be the same as the previously queried relative path"./usr/bin/ls "; otherwise, the extraction fails.

 

Cpio parameter description:

-T indicates the meaning of the List, and"-- List"Equivalent," relative path "is listed at this time"

-I: the meaning of the extraction, and"-- Extract"Equivalent

-D: the meaning of creating a directory, and "--Make-directories"Equivalent

-V redundant information output, and"-- Verbose"Equivalent

 

 

 

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.