本章介绍Linux系统软件的装置、卸载、配置、保护以及如何构建企业本地YUM光盘源及HTTP本地源。

1 RPM软件包治理

Linux软件包治理大抵可分为二进制包、源码包,应用的工具也各不相同。Linux常见软件包分为两种,别离是源代码包(Source Code)、二进制包(Binary Code),源代码包是没有通过编译的包,须要通过GCC、C++编译器环境编译能力运行,二进制包无需编译,能够间接装置应用。

通常而言,能够通过后缀简略区别源码包和二进制包,例如.tar.gz、.zip、.rar结尾的包通常称之为源码包,以.rpm结尾的软件包称之为二进制包。真正辨别是否为源码还是二进制还得基于代码外面的文件来判断,例如蕴含.h、.c、.cpp、.cc等结尾的源码文件,称之为源码包,而代码外面存在bin目录能够执行文件,称之为二进制包。

CentOS操作系统中有一款默认软件治理的工具,红帽包管理工具(Red Hat Package Manager,RPM)。

应用RPM工具能够对软件包实现疾速装置、治理及保护。RPM管理工具实用的操作系统包含:CentOS,RedHat,Fedora,SUSE等,RPM工具罕用于治理.rpm后缀结尾的软件包。

RPM软件包命令规定详解如下:

RPM包命名格局为:name-version.rpmname-version-noarch.rpmname-version-arch.src.rpm如下软件包格局:epel-release-6-8.noarch.rpmperl-Pod-Plainer-1.03-1.el6.noarch.rpm以yasm-1.2.0-4.el7.x86_64.rpm为列解析如下:RPM包格局解析如下:    name              软件名称,例如yasm、perl-pod-Plainer;    version         版本号,1.2.0通用格局:“主版本号.次版本号.修改号”;4示意是公布版本号,该RPM包是第几次编译生成的;    arch             实用的硬件平台,RPM反对的平台有:i386、i586、i686、x86_64、sparc、alpha等。    .rpm            后缀包示意编译好的二进制包,可用rpm命令间接装置;    .src.rpm        源代码包,源码编译生成.rpm格局的RPM包方可应用;    el*              软件包发行版本,el6示意该软件包实用于RHEL 6.x/CentOS 6.x;    devel:            开发包;    noarch:           软件包能够在任何平台上装置。

RPM工具命令详解如下:

RPM 选项 PACKAGE_NAME-a, --all                          查问所有已装置软件包;-q,--query                        示意询问用户,输入信息;-l, --list                      打印软件包的列表;-f, --file                         FILE查问蕴含FILE的软件包;-i, --info                         显示软件包信息,包含名称,版本,形容;-v, --verbose                   打印输出详细信息;-U, --upgrade                   降级RPM软件包;-h,--hash                       软件装置,能够打印装置进度条;--last                             列出软件包时,以安装时间排序,最新的在下面;-e, --erase                     卸载rpm软件包--force                         示意强制,强制装置或者卸载;--nodeps                        RPM包不依赖-l, --list                         列出软件包中的文件;--provides                         列出软件包提供的个性;-R, --requires                  列出软件包依赖的其它软件包;--scripts                       列出软件包自定义的小程序。 

RPM企业案例演示:

# 查看sysstat包是否装置;[root@superman-vm01 ~]# rpm -q sysstatpackage sysstat is not installed[root@superman-vm01 ~]# # 装置sysstat软件包;[root@superman-vm01 ~]# rpm -ivh sysstat-10.1.5-17.el7.x86_64.rpmPreparing...                          ################################# [100%]Updating / installing...   1:sysstat-10.1.5-17.el7            ################################# [100%][root@superman-vm01 ~]#         # 查看软件装置的门路;[root@superman-vm01 ~]# rpm -ql sysstat/etc/cron.d/sysstat/etc/sysconfig/sysstat/etc/sysconfig/sysstat.ioconf/usr/bin/cifsiostat/usr/bin/iostat/usr/bin/mpstat/usr/bin/nfsiostat-sysstat/usr/bin/pidstat/usr/bin/sadf/usr/bin/sar/usr/bin/tapestat..........                                     # 查看软件装置的版本信息;[root@superman-vm01 ~]# rpm -qi sysstatName        : sysstatVersion     : 10.1.5Release     : 17.el7Architecture: x86_64Install Date: Sat 10 Jul 2021 06:46:49 AM CSTGroup       : Applications/SystemSize        : 1172947License     : GPLv2+Signature   : RSA/SHA256, Mon 12 Nov 2018 10:47:27 PM CST, Key ID 24c6a8a7f4a80eb5Source RPM  : sysstat-10.1.5-17.el7.src.rpmBuild Date  : Wed 31 Oct 2018 04:04:26 AM CSTBuild Host  : x86-01.bsys.centos.orgRelocations : (not relocatable)Packager    : CentOS BuildSystem <http://bugs.centos.org>Vendor      : CentOSURL         : http://sebastien.godard.pagesperso-orange.fr/Summary     : Collection of performance monitoring tools for LinuxDescription :The sysstat package contains sar, sadf, mpstat, iostat, pidstat, nfsiostat-sysstat,tapestat, cifsiostat and sa tools for Linux...........# 卸载sysstat软件;[root@superman-vm01 ~]# rpm -qa|grep sysstatsysstat-10.1.5-17.el7.x86_64[root@superman-vm01 ~]# [root@superman-vm01 ~]# rpm -e sysstat-10.1.5-17.el7.x86_64[root@superman-vm01 ~]# # 降级sysstat软件;[root@superman-vm01 ~]# rpm -Uvh sysstat-10.1.5-17.el7.x86_64.rpm Preparing...                          ################################# [100%]Updating / installing...   1:sysstat-10.1.5-17.el7            ################################# [100%][root@superman-vm01 ~]# # 查看sysstat相干的软件包是否装置;[root@superman-vm01 ~]# rpm -qa|grep sysstat sysstat-10.1.5-17.el7.x86_64[root@superman-vm01 ~]# # 强制卸载sysstat;[root@superman-vm01 ~]# rpm -e --nodeps sysstat[root@superman-vm01 ~]## 不依赖其它软件包;[root@superman-vm01 ~]# rpm -ivh --nodeps sysstat-10.1.5-17.el7.x86_64.rpm Preparing...                          ################################# [100%]Updating / installing...   1:sysstat-10.1.5-17.el7            ################################# [100%][root@superman-vm01 ~]# 

2 Tar软件包治理

Linux操作系统除了应用RPM管理工具对软件包治理之外,还能够通过tar、zip、jar等工具进行源码包的治理。

2.1 Tar命令参数详解

-A, --catenate, --concatenate     将存档与已有的存档合并-c, --create                     建设新的存档-d, --diff, --compare            比拟存档与以后文件的不同之处--delete                        从存档中删除-r, --append                    附加到存档结尾-t, --list                      列出存档中文件的目录-u, --update                    仅将较新的文件附加到存档中-x, --extract, --get            解压文件-j, --bzip2, --bunzip2            有bz2属性的软件包;-z, --gzip, --ungzip            有gz属性的软件包;-b, --block-size N              指定块大小为Nx512字节(缺省时 N=20);-B, --read-full-blocks          读取时重组块;-C, --directory DIR             指定新的目录;--checkpoint                    读取存档时显示目录名;-f, --file [HOSTNAME:]F         指定存档或设施,后接文件名称;--force-local                   强制应用本地存档,即便存在克隆;-G, --incremental               建设老GNU格局的备份;-g, --listed-incremental        建设新GNU格局的备份;-h, --dereference               不转储动静链接,转储动静链接指向的文件;-i, --ignore-zeros              疏忽存档中的0字节块(通常意味着文件完结);--ignore-failed-read            在不可读文件中作0标记后再退出;-k, --keep-old-files            保留现有文件;从存档中开展时不进行笼罩;-K, --starting-file F           从存档文件F开始;-l, --one-file-system           在本地文件系统中创立存档;-L, --tape-length N             在写入N*1024个字节后暂停,期待更换磁盘;-m, --modification-time         当从一个档案中复原文件时,不应用新的工夫标签;-M, --multi-volume              建设多卷存档,以便在几个磁盘中寄存;-O, --to-stdout                 将文件开展到规范输入;-P, --absolute-paths            不要从文件名中去除'/';-v, --verbose                    具体显示解决的文件;--version                        显示tar程序的版本号;--exclude                         FILE不把指定文件蕴含在内;-X, --exclude-from FILE            从指定文件中读入不想蕴含的文件的列表。
2.2.1 TAR命令实战
# 查看keepalived-2.2.2.tar.gz包中内容;[root@superman-vm01 ~]# tar -tf keepalived-2.2.2.tar.gzkeepalived-2.2.2/keepalived-2.2.2/tools/keepalived-2.2.2/tools/timed_reloadkeepalived-2.2.2/Makefile.inkeepalived-2.2.2/build-aux/keepalived-2.2.2/build-aux/install-shkeepalived-2.2.2/build-aux/missingkeepalived-2.2.2/build-aux/compilekeepalived-2.2.2/build-aux/depcompkeepalived-2.2.2/build-aux/ar-libkeepalived-2.2.2/bin_install/keepalived-2.2.2/bin_install/Makefile.inkeepalived-2.2.2/bin_install/Makefile.amkeepalived-2.2.2/keepalived.spec.in..........# 解压keepalived-2.2.2.tar.gz程序包;[root@superman-vm01 ~]# tar -xvf keepalived-2.2.2.tar.gzkeepalived-2.2.2/keepalived-2.2.2/tools/keepalived-2.2.2/tools/timed_reloadkeepalived-2.2.2/Makefile.inkeepalived-2.2.2/build-aux/keepalived-2.2.2/build-aux/install-shkeepalived-2.2.2/build-aux/missingkeepalived-2.2.2/build-aux/compilekeepalived-2.2.2/build-aux/depcompkeepalived-2.2.2/build-aux/ar-libkeepalived-2.2.2/bin_install/keepalived-2.2.2/bin_install/Makefile.inkeepalived-2.2.2/bin_install/Makefile.amkeepalived-2.2.2/keepalived.spec.inkeepalived-2.2.2/snap/keepalived-2.2.2/snap/snapcraft.yamlkeepalived-2.2.2/snap/hooks/keepalived-2.2.2/snap/hooks/post-refreshkeepalived-2.2.2/snap/hooks/installkeepalived-2.2.2/INSTALLkeepalived-2.2.2/doc/keepalived-2.2.2/doc/Makefile.inkeepalived-2.2.2/doc/man/keepalived-2.2.2/doc/man/man8/........# 打包keepalived文件或者目录,打包后名称keepalived-2.2.2.tar;[root@superman-vm01 ~]# tar -cvf keepalived-2.2.2.tar keepalived-2.2.2keepalived-2.2.2/keepalived-2.2.2/tools/keepalived-2.2.2/tools/timed_reloadkeepalived-2.2.2/Makefile.inkeepalived-2.2.2/build-aux/keepalived-2.2.2/build-aux/install-shkeepalived-2.2.2/build-aux/missingkeepalived-2.2.2/build-aux/compilekeepalived-2.2.2/build-aux/depcompkeepalived-2.2.2/build-aux/ar-libkeepalived-2.2.2/bin_install/keepalived-2.2.2/bin_install/Makefile.inkeepalived-2.2.2/bin_install/Makefile.amkeepalived-2.2.2/keepalived.spec.inkeepalived-2.2.2/snap/keepalived-2.2.2/snap/snapcraft.yamlkeepalived-2.2.2/snap/hooks/keepalived-2.2.2/snap/hooks/post-refreshkeepalived-2.2.2/snap/hooks/installkeepalived-2.2.2/INSTALLkeepalived-2.2.2/doc/keepalived-2.2.2/doc/Makefile.inkeepalived-2.2.2/doc/man/keepalived-2.2.2/doc/man/man8/........# 将a.txt文件追加到keepalived-2.2.2.tar中;[root@superman-vm01 ~]# tar -rf keepalived-2.2.2.tar abc.txt[root@superman-vm01 ~]# [root@superman-vm01 ~]# tar tf keepalived-2.2.2.tar | grep abc.txt abc.txt[root@superman-vm01 ~]## 应用gzip格局打包并压缩keepalived-2.2.2目录;[root@superman-vm01 ~]# tar -czvf keepalived-2.2.2.tar.gz keepalived-2.2.2keepalived-2.2.2/keepalived-2.2.2/tools/keepalived-2.2.2/tools/timed_reloadkeepalived-2.2.2/Makefile.inkeepalived-2.2.2/build-aux/keepalived-2.2.2/build-aux/install-shkeepalived-2.2.2/build-aux/missingkeepalived-2.2.2/build-aux/compilekeepalived-2.2.2/build-aux/depcompkeepalived-2.2.2/build-aux/ar-libkeepalived-2.2.2/bin_install/keepalived-2.2.2/bin_install/Makefile.inkeepalived-2.2.2/bin_install/Makefile.amkeepalived-2.2.2/keepalived.spec.inkeepalived-2.2.2/snap/keepalived-2.2.2/snap/snapcraft.yamlkeepalived-2.2.2/snap/hooks/keepalived-2.2.2/snap/hooks/post-refreshkeepalived-2.2.2/snap/hooks/install.........# 应用bzip2格局打包并压缩superman目录;[root@superman-vm01 ~]# tar -cjvf keepalived-2.2.2.tar.bz2 keepalived-2.2.2keepalived-2.2.2/keepalived-2.2.2/tools/keepalived-2.2.2/tools/timed_reloadkeepalived-2.2.2/Makefile.inkeepalived-2.2.2/build-aux/keepalived-2.2.2/build-aux/install-shkeepalived-2.2.2/build-aux/missingkeepalived-2.2.2/build-aux/compilekeepalived-2.2.2/build-aux/depcompkeepalived-2.2.2/build-aux/ar-libkeepalived-2.2.2/bin_install/keepalived-2.2.2/bin_install/Makefile.inkeepalived-2.2.2/bin_install/Makefile.amkeepalived-2.2.2/keepalived.spec.inkeepalived-2.2.2/snap/keepalived-2.2.2/snap/snapcraft.yamlkeepalived-2.2.2/snap/hooks/keepalived-2.2.2/snap/hooks/post-refreshkeepalived-2.2.2/snap/hooks/install..........# 应用gzip格局打包并压缩当前目录所有文件,排除abc.txt中记录的文件;[root@superman-vm01 ceshi]# lsabc.txt  keepalived-2.2.2[root@superman-vm01 ceshi]# [root@superman-vm01 ceshi]# tar -czf keepalived-2.2.2.tar.gz * -X abc.txt[root@superman-vm01 ceshi]# [root@superman-vm01 ceshi]# tar tf keepalived-2.2.2.tar.gz | grep abc.txtabc.txt[root@superman-vm01 ceshi]# # 应用gzip格局打包并压当前目录所有文件及目录,排除abc.txt。 [root@superman-vm01 ceshi]# lsabc.txt  keepalived-2.2.2[root@superman-vm01 ceshi]# [root@superman-vm01 ceshi]# tar -czf keepalived-2.2.2.tar.gz * --exclude=abc.txt[root@superman-vm01 ceshi]# [root@superman-vm01 ceshi]# tar tf keepalived-2.2.2.tar.gz | grep abc.txt[root@superman-vm01 ceshi]# 

3 源码包软件装置

通常应用RPM工具治理.rpm结尾的二进制包,而规范的.zip、tar结尾的源代码包则不能应用RPM工具去装置、卸载及降级,源码包装置有三个步骤,如下:

    ./configure       预编译,次要用于检测零碎基准环境库是否满足,生成MakeFile文件;    make              编译,基于第一步生成的makefile文件,进行源代码的编译;    make install      装置,编译结束之后,将相干的可运行文件装置至零碎中;应用make编译时,Linux操作系统必须有GCC编译器,用于编译源码。

源码包装置通常须要./configure、make、make install三个步骤,某些非凡源码能够只有三步中的其中一个步骤,或者两个步骤。

3.1 源码装置实战

以CentOS 7 Linux零碎为基准,在其上装置Nginx源码包,企业中源码装置的具体步骤如下:

1、nginx.org官网下载nginx-1.19.9.tar.gz包[root@superman-vm01 ~]# wget http://nginx.org/download/nginx-1.19.9.tar.gz--2021-07-10 07:43:34--  http://nginx.org/download/nginx-1.19.9.tar.gzResolving nginx.org (nginx.org)... 52.58.199.22, 3.125.197.172, 2a05:d014:edb:5702::6, ...Connecting to nginx.org (nginx.org)|52.58.199.22|:80... connected.HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.Retrying.--2021-07-10 07:43:35--  (try: 2)  http://nginx.org/download/nginx-1.19.9.tar.gzConnecting to nginx.org (nginx.org)|52.58.199.22|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 887908 (867K) [application/octet-stream]Saving to: ‘nginx-1.19.9.tar.gz’57% [=====================>                 ] 507,913     --.-K/s   in 16m 50s 2021-07-10 08:00:26 (503 B/s) - Read error at byte 507913/887908 (Connection timed out). Retrying.--2021-07-10 08:00:28--  (try: 3)  http://nginx.org/download/nginx-1.19.9.tar.gzConnecting to nginx.org (nginx.org)|52.58.199.22|:80... connected.HTTP request sent, awaiting response... 206 Partial ContentLength: 887908 (867K), 379995 (371K) remaining [application/octet-stream]Saving to: ‘nginx-1.19.9.tar.gz’100%[++++++++++++++++++++++================>] 887,908     6.46KB/s   in 52s    2021-07-10 08:01:20 (7.11 KB/s) - ‘nginx-1.19.9.tar.gz’ saved [887908/887908][root@superman-vm01 ~]# 2、Nginx源码包解压[root@superman-vm01 ~]# tar -xvf nginx-1.19.9.tar.gz  nginx-1.19.9/nginx-1.19.9/auto/nginx-1.19.9/conf/nginx-1.19.9/contrib/nginx-1.19.9/src/nginx-1.19.9/configurenginx-1.19.9/LICENSEnginx-1.19.9/READMEnginx-1.19.9/html/nginx-1.19.9/man/nginx-1.19.9/CHANGES.runginx-1.19.9/CHANGESnginx-1.19.9/man/nginx.8nginx-1.19.9/html/50x.htmlnginx-1.19.9/html/index.htmlnginx-1.19.9/src/core/..........3、源码Configure预编译,需进入解压后的目录执行./configure指令,分号“;”示意连贯多个命令。[root@superman-vm01 ~]# cd nginx-1.19.9/;./configurechecking for OS + Linux 3.10.0-957.el7.x86_64 x86_64checking for C compiler ... found + using GNU C compiler + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) checking for gcc -pipe switch ... foundchecking for gcc builtin atomic operations ... foundchecking for C99 variadic macros ... foundchecking for gcc variadic macros ... foundchecking for unistd.h ... foundchecking for inttypes.h ... foundchecking for limits.h ... foundchecking for sys/filio.h ... not foundchecking for sys/param.h ... foundchecking for sys/mount.h ... foundchecking for sys/statvfs.h ... foundchecking for crypt.h ... foundchecking for Linux specific featureschecking for epoll ... foundchecking for EPOLLRDHUP ... found...........5、make install装置[root@superman-vm01 nginx-1.19.9]# make installmake -f objs/Makefile installmake[1]: Entering directory `/root/nginx-1.19.9'test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'test -d '/usr/local/nginx/sbin'                 || mkdir -p '/usr/local/nginx/sbin'test ! -f '/usr/local/nginx/sbin/nginx'                 || mv '/usr/local/nginx/sbin/nginx'                     '/usr/local/nginx/sbin/nginx.old'cp objs/nginx '/usr/local/nginx/sbin/nginx'test -d '/usr/local/nginx/conf'                 || mkdir -p '/usr/local/nginx/conf'cp conf/koi-win '/usr/local/nginx/conf'cp conf/koi-utf '/usr/local/nginx/conf'cp conf/win-utf '/usr/local/nginx/conf'test -f '/usr/local/nginx/conf/mime.types'              || cp conf/mime.types '/usr/local/nginx/conf'cp conf/mime.types '/usr/local/nginx/conf/mime.types.default'test -f '/usr/local/nginx/conf/fastcgi_params'          || cp conf/fastcgi_params '/usr/local/nginx/conf'cp conf/fastcgi_params          '/usr/local/nginx/conf/fastcgi_params.default'test -f '/usr/local/nginx/conf/fastcgi.conf'            || cp conf/fastcgi.conf '/usr/local/nginx/conf'cp conf/fastcgi.conf '/usr/local/nginx/conf/fastcgi.conf.default'test -f '/usr/local/nginx/conf/uwsgi_params'            || cp conf/uwsgi_params '/usr/local/nginx/conf'cp conf/uwsgi_params            '/usr/local/nginx/conf/uwsgi_params.default'test -f '/usr/local/nginx/conf/scgi_params'             || cp conf/scgi_params '/usr/local/nginx/conf'cp conf/scgi_params             '/usr/local/nginx/conf/scgi_params.default'test -f '/usr/local/nginx/conf/nginx.conf'              || cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf'cp conf/nginx.conf '/usr/local/nginx/conf/nginx.conf.default'test -d '/usr/local/nginx/logs'                 || mkdir -p '/usr/local/nginx/logs'test -d '/usr/local/nginx/logs' ||              mkdir -p '/usr/local/nginx/logs'test -d '/usr/local/nginx/html'                 || cp -R html '/usr/local/nginx'test -d '/usr/local/nginx/logs' ||              mkdir -p '/usr/local/nginx/logs'make[1]: Leaving directory `/root/nginx-1.19.9'[root@superman-vm01 nginx-1.19.9]#  

通过以上五个步骤,源码包软件装置胜利,源码包在编译及装置时,可能会遇到各种谬误,须要把谬误解决之后,而后再进行下一步装置即可,前面章节会重点针对企业应用的软件进行案例演练。

4 YUM软件包治理

前端软件包管理器(Yellow Updater Modified,YUM)实用于CentOS、Fedora、RedHat及SUSE中的Shell命令行,次要用于治理RPM包,于RPM工具应用范畴相似,YUM工具可能从指定的服务器主动下载RPM包并且装置,还能够主动解决依赖性关系。

应用RPM工具治理和装置软件时,会发现rpm包有依赖,须要一一手动下载安装,而YUM工具的最大便当就是能够主动装置所有依赖的软件包,从而晋升效率,节省时间。

4.1 YUM工作原理

学习YUM,肯定要了解YUM工作原理,YUM失常运行,须要依赖两个局部,一是YUM源端,二是YUM客户端,也即用户应用端。

YUM客户端装置的所有RPM包都是来自YUM服务端,YUM源端通过HTTP或者FTP服务器公布。而YUM客户端可能从YUM源端下载依赖的RPM包是因为在YUM源端生成了RPM包的基准信息,包含RPM包版本号、配置文件、二进制信息、依赖关系等。

YUM客户端须要装置软件或者搜寻软件,会查找/etc/yum.repos.d下以.repo结尾文件,CentOS Linux默认的.repo文件名为CentOS-Base.repo,该文件中配置了YUM源端的镜像地址,所以每次装置、降级RPM包,YUM客户端均会查找.repo文件。

YUM客户端如果配置了CentOS官网repo源,客户端操作系统必须能联外网,满足网络条件,能力下载软件并装置,如果没有网络,也能够构建光盘源或者外部YUM源。在只有YUM客户端时,YUM客户端装置软件,默认会把YUM源地址、Header信息、软件包、数据库信息、缓存文件存储在/var/cache/yum中,每次应用YUM工具,YUM优先通过Cache查找相干软件包,Cache中不存在,而后在拜访外网YUM源。

4.2 YUM参数详解

因为YUM工具的应用简便、快捷、高效,在企业中失去宽泛的应用,失去泛滥IT运维、程序人员的青眼,要能纯熟应用YUM工具,须要先把握YUM命令行参数的应用,如下为YUM命令工具的参数详解及实战步骤:

YUM命令工具指南,YUM格局为:YUM [command] [package] -y|-q 其中的[options]是可选。-y装置或者卸载呈现YES时,主动确认yes;-q不显示装置的过程。yum install sysstat                     装置sysstat软件包;yum reinstall sysstat                   重新安装sysstat软件包yum search sysstat                        YUM搜寻软件包;yum list sysstat                           显示指定程序包装置状况sysstat;yum list                                  显示所有已装置及可装置的软件包;yum remove sysstat                         删除程序包sysstat;yum erase sysstat                         删除程序包sysstat;yum update                                  内核降级或者软件更新;yum update sysstat                         更新sysstat软件;yum check-update                         查看可更新的程序;yum info sysstat                           显示安装包信息sysstat;yum provides                             列出软件包提供哪些文件;yum provides "*/rz"                     列出rz命令由哪个软件包提供;yum grouplist                           询能够用groupinstall装置的组名称;yum groupinstall "Chinese Support"      装置中文反对;yum groupremove "Chinese Support"          删除程序组Chinese Support;yum deplist sysstat                     查看程序sysstat依赖状况;yum clean   packages                     革除缓存目录下的软件包;yum clean   headers                     革除缓存目录下的headers;yum clean   all                           革除缓存目录下的软件包及旧的headers。yum repolist {all|enabled|disabled}     列出所有/已启用/已禁用的yum源yum list {all|installed|avaliable}      列出所有/已装置/可装置的软件包
4.2.1 YUM装置实战

1、基于CentOS 7 Linux,执行命令yum install sysstat -y,装置sysstat服务

[root@superman-vm01 ~]# yum install sysstat -yLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.cn99.com * updates: mirrors.cn99.com    Resolving Dependencies    --> Running transaction check    ---> Package sysstat.x86_64 0:10.1.5-17.el7 will be updated    ---> Package sysstat.x86_64 0:10.1.5-19.el7 will be an update    --> Finished Dependency ResolutionDependencies Resolved================================================================================ Package          Arch            Version                   Repository     Size================================================================================Updating: sysstat          x86_64          10.1.5-19.el7             base          315 kTransaction Summary================================================================================Upgrade  1 PackageTotal size: 315 kDownloading packages:Running transaction checkRunning transaction testTransaction test succeededRunning transactionWarning: RPMDB altered outside of yum.  Updating   : sysstat-10.1.5-19.el7.x86_64                                 1/2   Cleanup    : sysstat-10.1.5-17.el7.x86_64                                 2/2   Verifying  : sysstat-10.1.5-19.el7.x86_64                                 1/2   Verifying  : sysstat-10.1.5-17.el7.x86_64                                 2/2 Updated:  sysstat.x86_64 0:10.1.5-19.el7                                                Complete![root@superman-vm01 ~]# 

2、执行命令yum grouplist,查看groupinstall的软件组名

[root@superman-vm01 ~]# yum grouplistLoaded plugins: fastestmirror, langpacksThere is no installed groups file.Maybe run: yum groups mark convert (see man yum)Loading mirror speeds from cached hostfile * base: mirrors.bfsu.edu.cn * extras: mirrors.bfsu.edu.cn * updates: mirrors.bfsu.edu.cnAvailable Environment Groups:   Minimal Install   Compute Node   Infrastructure Server   File and Print Server   Basic Web Server   Virtualization Host   Server with GUI   GNOME Desktop   KDE Plasma Workspaces   Development and Creative WorkstationAvailable Groups:   Compatibility Libraries   Console Internet Tools   Development Tools   Graphical Administration Tools   Legacy UNIX Compatibility   Scientific Support   Security Tools   Smart Card Support   System Administration Tools   System ManagementDone[root@superman-vm01 ~]# 

3、执行命令yum groupinstall "GNOME Desktop" -y,装置Linux图像界面

[root@superman-vm01 ~]# yum groupinstall "GNOME Desktop" -yLoaded plugins: fastestmirror, langpacksThere is no installed groups file.Maybe run: yum groups mark convert (see man yum)Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.bfsu.edu.cnWarning: Group core does not have any packages to install.Warning: Group gnome-desktop does not have any packages to install.Warning: Group guest-agents does not have any packages to install.Package gtk2-immodule-xim-2.24.31-1.el7.x86_64 already installed and latest versionWarning: Group guest-desktop-agents does not have any packages to install.Warning: Group fonts does not have any packages to install.Warning: Group print-client does not have any packages to install.Warning: Group desktop-debugging does not have any packages to install.Warning: Group dial-up does not have any packages to install.Package gstreamer1-plugins-bad-free-1.10.4-3.el7.x86_64 already installed and latest versionPackage gstreamer1-plugins-good-1.10.4-2.el7.x86_64 already installed and latest versionPackage gstreamer1-plugins-ugly-free-1.10.4-3.el7.x86_64 already installed and latest versionWarning: Group multimedia does not have any packages to install.Warning: Group base does not have any packages to install.Group base does have 1 conditional packages, which may get installed.Warning: Group internet-browser does not have any packages to install.Warning: Group x11 does not have any packages to install.Resolving Dependencies--> Running transaction check---> Package NetworkManager-bluetooth.x86_64 1:1.18.8-2.el7_9 will be installed.........

4、执行命令yum install sysstat php php-devel php-mysql mariadb mariadb-server -y,装置中小企业LAMP架构环境

[root@superman-vm01 ~]# yum install sysstat php php-devel php-mysql mariadb mariadb-server -yLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.cn99.com * updates: mirrors.cn99.comPackage sysstat-10.1.5-19.el7.x86_64 already installed and latest versionResolving Dependencies--> Running transaction check---> Package mariadb.x86_64 1:5.5.68-1.el7 will be installed--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.68-1.el7 for package: 1:mariadb-5.5.68-1.el7.x86_64---> Package mariadb-server.x86_64 1:5.5.68-1.el7 will be installed--> Processing Dependency: perl-DBD-MySQL for package: 1:mariadb-server-5.5.68-1.el7.x86_64---> Package php.x86_64 0:5.4.16-48.el7 will be installed--> Processing Dependency: php-common(x86-64) = 5.4.16-48.el7 for package: php-5.4.16-48.el7.x86_64..........

5、执行命令yum remove ntpdate -y,卸载ntpdate软件包

[root@superman-vm01 ~]# yum remove ntpdate -yLoaded plugins: fastestmirror, langpacksResolving Dependencies--> Running transaction check---> Package ntpdate.x86_64 0:4.2.6p5-29.el7.centos.2 will be erased--> Processing Dependency: ntpdate = 4.2.6p5-29.el7.centos.2 for package: ntp-4.2.6p5-29.el7.centos.2.x86_64--> Running transaction check---> Package ntp.x86_64 0:4.2.6p5-29.el7.centos.2 will be erased--> Processing Dependency: ntp for package: ipa-client-4.6.8-5.el7.centos.6.x86_64--> Running transaction check---> Package ipa-client.x86_64 0:4.6.8-5.el7.centos.6 will be erased--> Finished Dependency ResolutionDependencies Resolved================================================================================ Package         Arch        Version                        Repository     Size================================================================================Removing: ntpdate         x86_64      4.2.6p5-29.el7.centos.2        @base         121 kRemoving for dependencies: ipa-client      x86_64      4.6.8-5.el7.centos.6           @updates      255 k ntp             x86_64      4.2.6p5-29.el7.centos.2        @base         1.4 MTransaction Summary================================================================================Remove  1 Package (+2 Dependent packages)Installed size: 1.7 MDownloading packages:Running transaction checkRunning transaction testTransaction test succeededRunning transaction  Erasing    : ipa-client-4.6.8-5.el7.centos.6.x86_64                       1/3   Erasing    : ntp-4.2.6p5-29.el7.centos.2.x86_64                           2/3   Erasing    : ntpdate-4.2.6p5-29.el7.centos.2.x86_64                       3/3   Verifying  : ntp-4.2.6p5-29.el7.centos.2.x86_64                           1/3   Verifying  : ntpdate-4.2.6p5-29.el7.centos.2.x86_64                       2/3   Verifying  : ipa-client-4.6.8-5.el7.centos.6.x86_64                       3/3 Removed:  ntpdate.x86_64 0:4.2.6p5-29.el7.centos.2                                      Dependency Removed:  ipa-client.x86_64 0:4.6.8-5.el7.centos.6 ntp.x86_64 0:4.2.6p5-29.el7.centos.2Complete![root@superman-vm01 ~]# 

6、执行命令yum provides rz或者yum provides "*/rz",查找rz命令的提供者

[root@superman-vm01 ~]# yum provides rzLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.bfsu.edu.cn * extras: mirrors.bfsu.edu.cn * updates: mirrors.bfsu.edu.cnextras/7/x86_64/filelists_db                             | 235 kB     00:00     updates/7/x86_64/filelists_db                            | 5.1 MB     00:04     lrzsz-0.12.20-36.el7.x86_64 : The lrz and lsz modem communications programsRepo        : baseMatched from:Filename    : /usr/bin/rzlrzsz-0.12.20-36.el7.x86_64 : The lrz and lsz modem communications programsRepo        : @anacondaMatched from:Filename    : /usr/bin/rz[root@superman-vm01 ~]# [root@superman-vm01 ~]# yum provides "*/rz"Loaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.huaweicloud.com * extras: mirrors.huaweicloud.com * updates: mirrors.huaweicloud.comlrzsz-0.12.20-36.el7.x86_64 : The lrz and lsz modem communications programsRepo        : baseMatched from:Filename    : /usr/bin/rzlrzsz-0.12.20-36.el7.x86_64 : The lrz and lsz modem communications programsRepo        : @anacondaMatched from:Filename    : /usr/bin/rz[root@superman-vm01 ~]# 

7、执行命令yum update -y,降级Linux所有可更新的软件包或Linux内核降级

[root@superman-vm01 ~]# yum update -yLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.huaweicloud.comResolving Dependencies--> Running transaction check---> Package GeoIP.x86_64 0:1.5.0-13.el7 will be updated---> Package GeoIP.x86_64 0:1.5.0-14.el7 will be an update--> Processing Dependency: geoipupdate for package: GeoIP-1.5.0-14.el7.x86_64---> Package ModemManager.x86_64 0:1.6.10-1.el7 will be updated---> Package ModemManager.x86_64 0:1.6.10-4.el7 will be an update---> Package ModemManager-glib.x86_64 0:1.6.10-1.el7 will be updated---> Package ModemManager-glib.x86_64 0:1.6.10-4.el7 will be an update---> Package PackageKit.x86_64 0:1.1.10-1.el7.centos will be updated---> Package PackageKit.x86_64 0:1.1.10-2.el7.centos will be an update...........

4.3 配置网络源

# 装置163的yum源:[root@superman-vm01 ~]# wget -O /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo--2021-07-10 17:07:57--  http://mirrors.163.com/.help/CentOS7-Base-163.repoResolving mirrors.163.com (mirrors.163.com)... 1.193.221.38, 124.116.156.215, 124.116.156.214, ...Connecting to mirrors.163.com (mirrors.163.com)|1.193.221.38|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 1572 (1.5K) [application/octet-stream]Saving to: ‘/etc/yum.repos.d/CentOS7-Base-163.repo’100%[======================================>] 1,572       --.-K/s   in 0s      2021-07-10 17:07:57 (76.7 MB/s) - ‘/etc/yum.repos.d/CentOS7-Base-163.repo’ saved [1572/1572][root@superman-vm01 ~]# # 装置阿里云的yum源:[root@superman-vm01 ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo--2021-07-10 17:08:52--  http://mirrors.aliyun.com/repo/Centos-7.repoResolving mirrors.aliyun.com (mirrors.aliyun.com)... 1.180.14.242, 1.180.14.241, 1.180.14.248, ...Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|1.180.14.242|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 2523 (2.5K) [application/octet-stream]Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’100%[======================================>] 2,523       --.-K/s   in 0s      2021-07-10 17:08:52 (384 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523][root@superman-vm01 ~]# 
# 搜狐没有现成的yum源文件下载,须要本人配置:[root@superman-vm01 ~]# echo "[sohu]name=Centos-$releasever-sohubaseurl=http://mirrors.sohu.com/centos/$releasever/os/$basearchgpgcheck=1gpgkey=http://mirrors.sohu.com/centos/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-$releasever" > /etc/yum.repos.d/CentOS-souhu.repo[root@superman-vm01 ~]# [root@superman-vm01 ~]# [root@superman-vm01 ~]# [root@superman-vm01 ~]# yum makecacheLoaded plugins: fastestmirror, langpacksRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading mirror speeds from cached hostfile

4.4 配置本地源

[root@superman-vm01 ~]# mkdir /mnt/cdrom[root@superman-vm01 ~]# mount /dev/cdrom /mnt/cdromecho "[local]name=centos-$releasever-localbaseurl=file:///mnt/cdromgpgcheck=1gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-7" > /etc/yum.repos.d/centos-7-local.repomount: /dev/sr0 is write-protected, mounting read-only[root@superman-vm01 ~]# echo "[local]name=centos-$releasever-localbaseurl=file:///mnt/cdromgpgcheck=1gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-7" > /etc/yum.repos.d/centos-7-local.repo[root@superman-vm01 ~]# 

4.5 主动配置仓库

# 装置yum的扩大包:[root@superman-vm01 ~]# yum install yum-utils -y         Loaded plugins: fastestmirror, langpacksRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.combase                                                     | 3.6 kB     00:00     extras                                                   | 2.9 kB     00:00     local                                                    | 3.6 kB     00:00     updates                                                  | 2.9 kB     00:00   # 主动配置国内epel仓库:[root@superman-vm01 ~]# yum-config-manager --add-repo=https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/Loaded plugins: fastestmirror, langpacksRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationadding repo from: https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/[mirrors.tuna.tsinghua.edu.cn_epel_7_x86_64_]name=added from: https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/x86_64/enabled=1[root@superman-vm01 ~]# 

4.6 禁用/启用仓库

# epel 是仓库的id [epel][root@superman-vm01 ~]# yum-config-manager --disable epelLoaded plugins: fastestmirror, langpacksRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configuration[root@superman-vm01 ~]# [root@superman-vm01 ~]# yum-config-manager --enable epelLoaded plugins: fastestmirror, langpacksRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configuration[root@superman-vm01 ~]# # 查看仓库状态:[root@superman-vm01 ~]# yum repolist allLoaded plugins: fastestmirror, langpacksRepository 'sohu' is missing name in configuration, using idRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading mirror speeds from cached hostfileLoading mirror speeds from cached hostfileLoading mirror speeds from cached hostfileLoading mirror speeds from cached hostfileLoading mirror speeds from cached hostfilerepo id                             repo name                         statusC7.0.1406-base/x86_64               CentOS-7.0.1406 - Base            disabledC7.0.1406-centosplus/x86_64         CentOS-7.0.1406 - CentOSPlus      disabledC7.0.1406-extras/x86_64             CentOS-7.0.1406 - Extras          disabledC7.0.1406-fasttrack/x86_64          CentOS-7.0.1406 - Fasttrack       disabledC7.0.1406-updates/x86_64            CentOS-7.0.1406 - Updates         disabledC7.1.1503-base/x86_64               CentOS-7.1.1503 - Base            disabledC7.1.1503-centosplus/x86_64         CentOS-7.1.1503 - CentOSPlus      disabledC7.1.1503-extras/x86_64             CentOS-7.1.1503 - Extras          disabledC7.1.1503-fasttrack/x86_64          CentOS-7.1.1503 - Fasttrack       disabledC7.1.1503-updates/x86_64            CentOS-7.1.1503 - Updates         disabledC7.2.1511-base/x86_64               CentOS-7.2.1511 - Base            disabledC7.2.1511-centosplus/x86_64         CentOS-7.2.1511 - CentOSPlus      disabledC7.2.1511-extras/x86_64             CentOS-7.2.1511 - Extras          disabledC7.2.1511-fasttrack/x86_64          CentOS-7.2.1511 - Fasttrack       disabledC7.2.1511-updates/x86_64            CentOS-7.2.1511 - Updates         disabledC7.3.1611-base/x86_64               CentOS-7.3.1611 - Base            disabledC7.3.1611-centosplus/x86_64         CentOS-7.3.1611 - CentOSPlus      disabledC7.3.1611-extras/x86_64             CentOS-7.3.1611 - Extras          disabledC7.3.1611-fasttrack/x86_64          CentOS-7.3.1611 - Fasttrack       disabledC7.3.1611-updates/x86_64            CentOS-7.3.1611 - Updates         disabledC7.4.1708-base/x86_64               CentOS-7.4.1708 - Base            disabledC7.4.1708-centosplus/x86_64         CentOS-7.4.1708 - CentOSPlus      disabledC7.4.1708-extras/x86_64             CentOS-7.4.1708 - Extras          disabledC7.4.1708-fasttrack/x86_64          CentOS-7.4.1708 - Fasttrack       disabledC7.4.1708-updates/x86_64            CentOS-7.4.1708 - Updates         disabledC7.5.1804-base/x86_64               CentOS-7.5.1804 - Base            disabledC7.5.1804-centosplus/x86_64         CentOS-7.5.1804 - CentOSPlus      disabledC7.5.1804-extras/x86_64             CentOS-7.5.1804 - Extras          disabledC7.5.1804-fasttrack/x86_64          CentOS-7.5.1804 - Fasttrack       disabledC7.5.1804-updates/x86_64            CentOS-7.5.1804 - Updates         disabledC7.6.1810-base/x86_64               CentOS-7.6.1810 - Base            disabledC7.6.1810-centosplus/x86_64         CentOS-7.6.1810 - CentOSPlus      disabledC7.6.1810-extras/x86_64             CentOS-7.6.1810 - Extras          disabledC7.6.1810-fasttrack/x86_64          CentOS-7.6.1810 - Fasttrack       disabledC7.6.1810-updates/x86_64            CentOS-7.6.1810 - Updates         disabledC7.7.1908-base/x86_64               CentOS-7.7.1908 - Base            disabledC7.7.1908-centosplus/x86_64         CentOS-7.7.1908 - CentOSPlus      disabledC7.7.1908-extras/x86_64             CentOS-7.7.1908 - Extras          disabledC7.7.1908-fasttrack/x86_64          CentOS-7.7.1908 - Fasttrack       disabledC7.7.1908-updates/x86_64            CentOS-7.7.1908 - Updates         disabledC7.8.2003-base/x86_64               CentOS-7.8.2003 - Base            disabledC7.8.2003-centosplus/x86_64         CentOS-7.8.2003 - CentOSPlus      disabledC7.8.2003-extras/x86_64             CentOS-7.8.2003 - Extras          disabledC7.8.2003-fasttrack/x86_64          CentOS-7.8.2003 - Fasttrack       disabledC7.8.2003-updates/x86_64            CentOS-7.8.2003 - Updates         disabledbase/7/x86_64                       CentOS-7 - Base - mirrors.aliyun. enabled: 0base-debuginfo/x86_64               CentOS-7 - Debuginfo              disabledbase-source/7                       CentOS-7 - Base Sources           disabledc7-media                            CentOS-7 - Media                  disabledcentos-kernel/7/x86_64              CentOS LTS Kernels for x86_64     disabledcentos-kernel-experimental/7/x86_64 CentOS Experimental Kernels for x disabledcentosplus/7/x86_64                 CentOS-7 - Plus - mirrors.aliyun. disabledcentosplus-source/7                 CentOS-7 - Plus Sources           disabledcontrib/7/x86_64                    CentOS-7 - Contrib - mirrors.aliy disabledcr/7/x86_64                         CentOS-7 - cr                     disabledextras/7/x86_64                     CentOS-7 - Extras - mirrors.aliyu enabled: 0extras-source/7                     CentOS-7 - Extras Sources         disabledfasttrack/7/x86_64                  CentOS-7 - fasttrack              disabledsohu                                sohu                              enabled: 0updates/7/x86_64                    CentOS-7 - Updates - mirrors.aliy enabled: 0updates-source/7                    CentOS-7 - Updates Sources        disabledrepolist: 0[root@superman-vm01 ~]#

5. 同步外网源

在企业理论利用场景中,仅仅靠光盘外面的RPM软件包是不能满足需要,咱们能够把外网的YUM源中的所有软件包同步至本地,能够欠缺本地YUM源的软件包数量及完整性。

5.1 装置reposync工具

[root@superman-vm01 ~]# yum install yum-utils createrepo -yLoaded plugins: fastestmirror, langpacksRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.commirrors.tuna.tsinghua.edu.cn_epel_7_x86_64_              | 4.7 kB     00:00     (1/3): mirrors.tuna.tsinghua.edu.cn_epel_7_x86_64_/group_g |  96 kB   00:00     (2/3): mirrors.tuna.tsinghua.edu.cn_epel_7_x86_64_/updatei | 1.0 MB   00:04     (3/3): mirrors.tuna.tsinghua.edu.cn_epel_7_x86_64_/primary | 6.9 MB   00:07 

5.2 同步源

# 创立本地目录:[root@superman-vm01 ~]# mkdir /data/{centos,epel}[root@superman-vm01 ~]# # 同步yum源:[root@superman-vm01 ~]# reposync -r base -r updates -p /data/centos/Repository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationNo Presto metadata available for base389-ds-base-1.3.10.2-6.el7.x86 FAILED                                          389-ds-base-devel-1.3.10.2-6.e FAILED                                           (1/10072): 389-ds-base-snmp-1.3.10.2-6.el7.x86_64.rpm      | 178 kB   00:00     (2/10072): ElectricFence-2.2.2-39.el7.i686.rpm             |  35 kB   00:00     (3/10072): ElectricFence-2.2.2-39.el7.x86_64.rpm           |  35 kB   00:00     (4/10072): GConf2-3.2.6-8.el7.i686.rpm                     | 1.0 MB   00:01     (5/10072): Cython-0.19-5.el7.x86_64.rpm                    | 1.9 MB   00:03     (6/10072): GConf2-3.2.6-8.el7.x86_64.rpm                   | 1.0 MB   00:01     (7/10072): GConf2-devel-3.2.6-8.el7.i686.rpm               | 110 kB   00:00     (8/10072): GConf2-devel-3.2.6-8.el7.x86_64.rpm             | 110 kB   00:00  .........# 生成元数据:[root@superman-vm01 ~]# createrepo /data/centos[root@superman-vm01 ~]# # 联合后面所学制作本地源,如果想让其它服务器应用该源,前面能够联合nginx公布。

欢送关注我的微信公众号【超哥的IT私房菜】获取更多技术干货!

有什么吐槽或反馈意见,间接通知我!
我会解决您说的问题,进一步更好的服务您哦!