List of articles


This article is a step-by-step study - The second part of the basic part 41 An article

Today we talk about the management of software package , There are only two kinds of software packages :

  • RPM package
  • yum package

###1. RPM package

1) RPM Install common parameters :

Parameters effect
i install (Install) Software .
U upgrade (Upgrade) Old versions of software .
e remove / Delete (Erase) Software .
v Display detailed processing information .
h Show installation progress . Uninstall cannot be used
a (all) Query all installed packages
f (file) System filename ( Query which software package the system file belongs to ), Reverse query
i Show installed rpm Package information , The name of the bag is directly in the back
l (list) Query the installation location of the files in the package
p Query for information about packages that are not installed , It's followed by the name of the software
R Query package dependencies

2) rpm Access method :

  1. System image disc
  2. Website ( The source shared by Alibaba cloud )
  3. The official website of the corresponding software .

3) rpm Format :

[root@xinsz08-1 ~]# ls /mnt/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm /mnt/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm

name effect
lrzsz Software name
-0 The major version number
12 Sub version number
20 Revision number
27 release Which release
el6 operating system
x86_64.rpm The package is 64 Bit package

give an example :

a. Install the package locally
[root@xinsz08-1 ~]# rpm -ivh /mnt/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm warning: /mnt/Packages/lrzsz-0.12.20-27.1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                ########################################### [100%]package lrzsz-0.12.20-27.1.el6.x86_64 is already installed[root@xinsz08-1 ~]#

b. Inquire about lrzsz Is your package installed
[root@xinsz08-1 ~]# rpm -q lrzszlrzsz-0.12.20-27.1.el6.x86_64

c. Check all installed packages
[root@xinsz08-1 ~]# rpm -qa |wc -l1135

d. Query which package a command is installed in
[root@xinsz08-1 ~]# which rz/usr/bin/rz[root@xinsz08-1 ~]# rpm -qf /usr/bin/rzlrzsz-0.12.20-27.1.el6.x86_64

e. Delete a package using -e Parameters
[root@xinsz08-1 ~]# rpm -e lrzsz[root@xinsz08-1 ~]# rpm -ql lrzsz[root@xinsz08-1 ~]#

f. If there are dependencies, add parameters --nodeps

[root@xinsz08-1 ~]# rpm -e lrzsz --nodeps

g. Upgrade package

rpm -Uvh /mnt/Packages/lrzsz-XXXX

rpm Packet verification

effect : see rpm Is it modified

Parameters :

Options explain
-V Verification designation RPM Files in package , If the files contained in the software have been changed , It will be listed ;
-Va Verify that all packages installed on this machine
-Vf Verify that a system file has been modified

We use httpd As an example , See if it's been altered

[root@zmgaosh gaosh]# yum install httpd    install httpd[root@zmgaosh gaosh]# rpm -V httpd[root@xinsz08-1 ~]# vim /etc/init.d/httpd  #6 The system of [root@xinsz08-1 ~]# vim /etc/init.d/httpd   # modify httpd file [root@xinsz08-1 ~]# rpm -V httpdS.5....T.    /etc/rc.d/init.d/httpd

You can see that if it hasn't been changed ,rpm -V There is no output . If it's changed , It's the output of the content

Here is an explanation of the output :

character message
S The file size has changed ;
M The type of file or the permissions of the file (rwx) Changed ;
5 file MD5 Is the checksum changed ( It can be seen that the content of the file has changed );
D The master-slave code of the device has changed ;
L File path changed ;
U Owner of document ( owner ) Changed ;
G The group of the file has changed ;
T The modification time of the file has changed ;
P (caPabilities differ) The function has been changed ;

We can also modify it httpd.conf Take a look at the output

[root@xinsz08-1 ~]# rpm -Vf /etc/httpd/conf/httpd.conf
S.5…T. c /etc/httpd/conf/httpd.conf

There's a c, c Here is the file type

Other types are shown in the figure :

character Show content
c The configuration file
d General documents
l Authorization documents
r Description file

summary :

rpm The use of bags is also used more in daily work , Such as installation ELK, You can download the corresponding RPM To install , Convenient and quick .

I am Gao Shenghan , A person who never forgets his original intention in the teaching and training industry . Welcome to my collection , See you next time !