{"id":207,"date":"2021-07-28T11:09:58","date_gmt":"2021-07-28T03:09:58","guid":{"rendered":"http:\/\/egonlin.com\/?p=207"},"modified":"2024-03-19T10:03:33","modified_gmt":"2024-03-19T02:03:33","slug":"%e8%bd%af%e4%bb%b6%e5%8c%85%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=207","title":{"rendered":"\u8f6f\u4ef6\u5305\u7ba1\u7406"},"content":{"rendered":"<h1>\u8f6f\u4ef6\u5305\u7ba1\u7406<\/h1>\n<h2>\u4e00 \u8f6f\u4ef6\u5305\u79cd\u7c7b<\/h2>\n<p>\u7ea2\u5e3d\/Fedora\u7cfbLinux\u8f6f\u4ef6\u5305<\/p>\n<table>\n<thead>\n<tr>\n<th>\u5206\u7c7b<\/th>\n<th>\u5b89\u88c5<\/th>\n<th>\u4f18\u7f3a\u70b9<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>rpm\u5305<\/strong><\/td>\n<td><strong>\u9884\u5148\u7f16\u8bd1\u6253\u5305,\u5b89\u88c5\u7b80\u5355<\/strong><\/td>\n<td><strong>\u4f18\u70b9\uff1a\u672c\u8d28\u5c31\u662f\u4e00\u79cd\u538b\u7f29\u5305\uff0c\u5305\u5185\u9884\u5b9a\u5236\u597d\u4e86\u4e00\u4e9b\u811a\u672c\uff0c\u89c4\u5b9a\u597d\u4e86\u6309\u7167\u7684\u76ee\u6807\u4f4d\u7f6e\u7b49\uff0c\u5168\u90fd\u662f\u6309\u7167\u5b98\u65b9\u6807\u51c6\u8d70\uff0c\u5b89\u88c5\u7b80\u5355<br \/>\u7f3a\u70b9\uff1a\u7f3a\u4e4f\u53ef\u5b9a\u5236\u7684\u7075\u6d3b\u6027\uff1b\u5e76\u4e14\u901a\u5e38\u53ea\u6709\u8f6f\u4ef6\u7684\u7a33\u5b9a\u7248\u624d\u4f1a\u88ab\u5b98\u65b9\u505a\u6210rpm\u5305\uff0c\u6240\u4ee5\u8f6f\u4ef6\u7248\u672c\u4f1a\u504f\u4f4e<br \/>\u8de8\u5e73\u53f0\u6027\uff1a\u4e0e\u5e73\u53f0\u9ad8\u5ea6\u7ed1\u5b9a<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>\u6e90\u7801\u5305<\/strong><\/td>\n<td><strong>\u624b\u52a8\u7f16\u8bd1\u6253\u5305,\u5b89\u88c5\u7e41\u7410<\/strong><\/td>\n<td><strong>\u4f18\u70b9\uff1a\u53ef\u5b9a\u5236\u6027\u5f3a\uff0c\u8f6f\u4ef6\u7248\u672c\u4e30\u5bcc\uff0c\u6700\u65b0\u7684\u5305\u80af\u5b9a\u90fd\u662f\u6e90\u7801\u5305<br \/>\u7f3a\u70b9\uff1a\u5b89\u88c5\u7e41\u7410\u4e14\u901f\u5ea6\u6162\uff0c\u9700\u8981\u81ea\u5df1\u89e3\u51b3\u5f88\u591a\u4f9d\u8d56\u5305\u7684\u5b89\u88c5<br \/>\u8de8\u5e73\u53f0\u6027\uff1a\u53ef\u4ee5\u6839\u636e\u4e0d\u540c\u5e73\u53f0\u8fdb\u884c\u5b9a\u5236\u5316\u7684\u7f16\u8bd1\u5b89\u88c5<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>\u4e8c\u8fdb\u5236\u5305<\/strong><\/td>\n<td><strong>\u89e3\u538b\u5373\u53ef\u4f7f\u7528, \u5b89\u88c5\u7b80\u5355<\/strong><\/td>\n<td><strong>\u4f18\u70b9\uff1a\u89e3\u538b\u5c31\u80fd\u7528\uff0c\u5341\u5206\u7b80\u5355\u9ad8\u6548<br \/>\u7f3a\u70b9\uff1a\u7f3a\u4e4f\u53ef\u5b9a\u5236\u7684\u7075\u6d3b\u6027\uff1b\u9664\u4e86\u53ef\u4ee5\u6539\u53d8\u5b89\u88c5\u76ee\u5f55\u5916\uff0c\u5176\u4ed6\u7684\u90fd\u53ea\u80fd\u7528\u73b0\u6210\u7684\uff0c\u6240\u4ee5\u8bf4\uff0c\u5b83\u5b9a\u5236\u5316\u80fd\u6bd4rpm\u5305\u8981\u5f3a\u4e00\u4e43\u4e43\uff0c\u4f46\u4e5f\u662f\u534a\u65a4\u516b\u4e24<br \/>\u8de8\u5e73\u53f0\u6027\uff1a\u4e0e\u5e73\u53f0\u9ad8\u5ea6\u7ed1\u5b9a\uff0c\u6362\u4e2a\u5e73\u53f0\u5c31\u4e0d\u4e00\u5b9a\u53ef\u4ee5\u8fd0\u884c<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u4e8c rpm\u5305\u7ba1\u7406<\/h2>\n<h3>1\u3001 \u4ec0\u4e48\u662frpm\u5305<\/h3>\n<p>\u5728\u7ea2\u5e3d\/Fedora\u7cfb\u7684linux\u7cfb\u7edf\u4e0a\uff0c\u591a\u6570\u8f6f\u4ef6\u7684\u5b89\u88c5\u3001\u5347\u7ea7\u3001\u79fb\u9664\u4ee5\u53ca\u7ef4\u62a4\u5de5\u4f5c\u90fd\u662f\u4f7f\u7528RPM\u8f6f\u4ef6\u5305\u7ba1\u7406\u7a0b\u5e8f\u6765\u5b8c\u6210\u7684\uff0c\u90a3\u4ec0\u4e48\u662fRPM\u8f6f\u4ef6\u5305\u5462\uff1f<\/p>\n<pre><code class=\"language-python\">RPM \u662fRed-Hat Package Manager\uff08RPM\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\uff09\u7684\u7f29\u5199\uff0c\u8fd9\u4e00\u6587\u4ef6\u683c\u5f0f\u540d\u79f0\u867d\u7136\u6253\u4e0a\u4e86RedHat\u7684\u6807\u5fd7\uff0c\u4f46\u662f\u5176\u539f\u59cb\u8bbe\u8ba1\u7406\u5ff5\u662f\u5f00\u653e\u5f0f\u7684\uff0c\u901a\u5e38\u8f6f\u4ef6\u7684\u7a33\u5b9a\u7248\u4f1a\u88ab\u5b98\u65b9\u505a\u6210rpm\uff0c\u6240\u4ee5\u8f6f\u4ef6\u7248\u672c\u504f\u4f4e\u3002\n<\/code><\/pre>\n<h3>2\u3001rpm\u5305\u683c\u5f0f<\/h3>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/rpm.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/rpm.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><\/p>\n<h3>3\u3001RPM\u5305\u683c\u5f0f\u4e3e\u4f8b<\/h3>\n<pre><code class=\"language-python\"># \u4f8b1\nmysql-connector-odbc-5.2.5-8.el7.x86_64.rpm\n\n\u8f6f\u4ef6\u5305\u540d\uff1amysql-connector-odbc\n\u7248\u672c\u53f7Version\uff1a5.2.5\n\u53d1\u5e03\u7248\u672cRelease\uff1a8.el7\n\u5e73\u53f0\uff1ael7.x86_64\n\u540e\u7f00\uff1a.rpm\n\n# \u4f8b2\nabrt-python-doc-2.1.11-57.el7.centos.noarch.rpm\n\nabrt-python-doc     #\u8f6f\u4ef6\u5305\u7684\u540d\u79f0\n\n2.1.11              #\u8f6f\u4ef6\u7684\u7248\u672c \n\n57                  #\u8f6f\u4ef6\u7f16\u8bd1\u4e4b\u540e\u7684\u53d1\u5e03\u7684\u6b21\u6570 \n\nel7                 #\u9002\u5408\u7684\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c \n\nnoarch              #\u9002\u7528\u4e8e\u4e0d\u540c\u7248\u672c\u7684CPU  \n\n.rpm                #\u540e\u7f00\u540d <\/code><\/pre>\n<h3>4\u3001RPM\u5305\u4f7f\u7528\u7684\u5e73\u53f0<\/h3>\n<p>\u5e73\u53f0=\u64cd\u4f5c\u7cfb\u7edf+\u786c\u4ef6<br \/>\nps\uff1a\u786c\u4ef6\u4e3b\u8981\u662fcpu\u7684\u67b6\u6784\u5982x84\u3001arm\u7b49<\/p>\n<pre><code># \u652f\u6301\u7684\u64cd\u4f5c\u7cfb\u7edf\nredhat\/centos\/fedora\/suse\n# \u652f\u6301\u7684cpu\u67b6\u6784\uff1a\u5728\u5305\u540d\u5185\u6709\u58f0\u660e\uff0c\u6211\u4eec\u8981\u5230\u5e73\u53f0\u4e0auname -m\u770b\u4e0b\u81ea\u5df1\u662f\u5426\u7b26\u5408\n\n# \u67e5\u770b\u81ea\u5df1\u5f53\u524d\u5e73\u53f0\n[root@localhost ~]# uname -m  # \u67e5\u770bcpu\u7684\u67b6\u6784\nx86_64\n[root@localhost ~]# cat \/etc\/redhat-release   # \u67e5\u770b\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\nCentOS Linux release 7.6.1810 (Core) <\/code><\/pre>\n<h3>5\u3001\u7ba1\u7406rpm\u5305\u6709\u4e24\u79cd\u547d\u4ee4<\/h3>\n<pre><code class=\"language-python\"># 1\u3001rpm\u547d\u4ee4\uff1a\n    \u9700\u8981\u81ea\u5df1\u627e\u5230rpm\u5305\uff0c\u5e76\u4e14\u624b\u52a8\u89e3\u51b3\u5305\u7684\u4f9d\u8d56\u6027\u5173\u7cfb\n    ps\uff1a\u5b9e\u9645\u60c5\u51b5\u4e0b\uff0c\u5f88\u96be\u5206\u8fa8\u7f3a\u5c11\u4ec0\u4e48\u4f9d\u8d56\u5305\n\n# 2\u3001yum\u547d\u4ee4\uff1a\n    \u76f8\u5173rpm\u5305\u4e8b\u5148\u90fd\u88ab\u5b58\u653e\u4e8e\u4e00\u4e2a\u4ed3\u5e93\u91cc\uff0c\u4ed3\u5e93\u5305\u542b\u4e86\u6240\u6709\u7684\u4f9d\u8d56\u5305\uff0c\u6240\u4ee5yum\u6309\u7167\u53ef\u4ee5\u5e2e\u6211\u4eec\u89e3\u51b3\u4f9d\u8d56\u6027\u95ee\u9898<\/code><\/pre>\n<h3>6\u3001RPM\u5305\u83b7\u53d6<\/h3>\n<pre><code class=\"language-python\"># 1.\u672c\u5730\u7684ISO\u955c\u50cf\u5149\u76d8(\u8f6f\u4ef6\u5305\u53ef\u80fd\u5b58\u5728\u7248\u672c\u504f\u4f4e\u60c5\u51b5) : \u6302\u8f7d\u955c\u50cf\u6709\u4ee5\u4e0b\u4e09\u79cd\u65b9\u5f0f\n\u65b9\u5f0f1\uff1a\n[root@localhost ~]# mount \/dev\/cdrom \/opt\/\n\n\u65b9\u5f0f2\uff1a\n[root@localhost ~]# mount \/dev\/sr0 \/opt\/\n\n\u65b9\u5f0f3\n[root@localhost ~]# mount -o loop \/xxx.iso \/opt\n\n\u67e5\u770b\u5149\u76d8\u91cc\u7684rpm\u5305\n[root@localhost ~]# ls \/opt\/Packages\/ # centos7\n[root@localhost ~]# ls \/opt\/minimal\/Packages\/ # rockylinux9.3\n\n# 2.\u81ea\u5df1\u53bb\u7f51\u4e0a\u4e0b\u8f7drpm\u5305\u8fdb\u884c\u5b89\u88c5\n\n# 3.\u8054\u7f51\u4eceyum\u4ed3\u5e93\u91cc\u83b7\u53d6rpm\u5305                         # yum\u7684\u65f6\u5019<\/code><\/pre>\n<h2>\u4e09 rpm\u547d\u4ee4<\/h2>\n<h3>1\u3001\u9009\u9879<\/h3>\n<pre><code class=\"language-python\">#1\u3001\u5b89\u88c5\uff1arpm -ivh &lt;RPM\u5305\u540d\u5168\u79f0&gt;\n\n#2\u3001\u5378\u8f7d\uff1arpm -e &lt;RPM\u5305\u540d&gt;\n\n#3\u3001\u5347\u7ea7\uff1arpm -Uvh &lt;RPM\u5305\u540d&gt;\n\n#4\u3001\u67e5\u8be2\uff1a\nrpm -qa                      #\u67e5\u8be2\u7cfb\u7edf\u4e2d\u5b89\u88c5\u7684\u6240\u6709RPM\u8f6f\u4ef6\u5305\n\nrpm -qa | grep php \u3000\u3000      #\u68c0\u7d22\u7cfb\u7edf\u4e2d\u5df2\u7ecf\u5b89\u88c5\u6709\u5173php\u7684\u8f6f\u4ef6\u5305\n\nrpm -q &lt;RPM\u5305\u540d&gt; \u3000\u3000         #\u67e5\u8be2\u6307\u5b9a\u8f6f\u4ef6\u5305\u662f\u5426\u5df2\u5b89\u88c5\n                             [root@egon ~]# rpm -q zip\n                             zip-3.0-11.el7.x86_64\n\nrpm -qi &lt;RPM\u5305\u540d&gt; \u3000\u3000        #\u67e5\u8be2\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5\u5305\u7684\u63cf\u8ff0\u4fe1\u606f\n\nrpm -ql &lt;RPM\u5305\u540d&gt; \u3000\u3000        #\u67e5\u8be2\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5\u5305\u91cc\u6240\u5305\u542b\u7684\u6587\u4ef6\n\nrpm -qc &lt;RPM\u5305\u540d&gt;             #\u67e5\u8be2\u6307\u5b9a\u8f6f\u4ef6\u5305\u7684\u6240\u6709\u914d\u7f6e\u6587\u4ef6\n                              [root@egon ~]# rpm -qc mariadb\n                               \/etc\/my.cnf.d\/client.cnf\n\nrpm -qd &lt;RPM\u5305\u540d&gt;              # \u67e5\u8be2\u67d0\u4e2a\u5305\u5b89\u88c5\u7684\u5e2e\u52a9\u6587\u6863\n                              [root@localhost ~]# rpm -qd zlib  \n\nrpm -qf \u6587\u4ef6\u8def\u5f84\u3000\u3000           #\u67e5\u8be2\u7cfb\u7edf\u4e2d\u6307\u5b9a\u6587\u4ef6\u6240\u5c5e\u7684\u8f6f\u4ef6\u5305\n                             [root@egon ~]# rpm -qf \/usr\/sbin\/ifconfig \n                              net-tools-2.0-0.25.20131004git.el7.x86_64\n\n-p                            # \u5728\u4e0a\u8ff0\u9009\u9879\u7684\u57fa\u7840\u4e0a\u52a0\u9009\u9879-p\uff0c\u5c31\u53ef\u4ee5\u67e5\u770b\u5c1a\u672a\u5b89\u88c5\u7684rpm\u5305\u4fe1\u606f\n[root@localhost ~]# rpm -e dos2unix  # \u5148\u5378\u8f7d\u4e00\u4e0b\uff0c\u8bc1\u660e\u672c\u5730rpm\u6570\u636e\u5e93\u4e2d\u6ca1\u6709\u8be5\u5305\u4fe1\u606f\n\n[root@rockylinux ~]# rpm -qip \/opt\/minimal\/Packages\/dos2unix-7.4.2-4.el9.x86_64.rpm \n[root@rockylinux ~]# rpm -qlp \/opt\/minimal\/Packages\/dos2unix-7.4.2-4.el9.x86_64.rpm\n[root@rockylinux ~]# rpm -qcp \/opt\/minimal\/Packages\/dos2unix-7.4.2-4.el9.x86_64.rpm\n[root@rockylinux ~]# rpm -qdp \/opt\/minimal\/Packages\/dos2unix-7.4.2-4.el9.x86_64.rpm\n\n\u989d\u5916\u9009\u9879\n--nomd5     # \u4e0d\u68c0\u9a8c\u8f6f\u4ef6\u5305\u7684\u7b7e\u540d\n--nodeps    # \u5ffd\u7565\u4f9d\u8d56\u6027\u5b89\u88c5\u8f6f\u4ef6\uff0c\u5b89\u88c5\u540e\u8f6f\u4ef6\u6709\u53ef\u80fd\u65e0\u6cd5\u4f7f\u7528\uff0c\u6700\u597d\u662f\u89e3\u51b3\u4f9d\u8d56\u6027\u540e\u518d\u5b89\u88c5\n             [root@localhost ~]# rpm -e dos2unix  --nodeps  # \u5ffd\u7565\u4f9d\u8d56\u5173\u7cfb\n\n--force     # \u5f3a\u5236\u5b89\u88c5\u8f6f\u4ef6\u5305,\u53ea\u6709\u5b89\u88c5\u548c\u5347\u7ea7\u53ef\u4ee5\u5f3a\u5236\u6267\u884c<\/code><\/pre>\n<h3>2\u3001\u5b89\u88c5<\/h3>\n<pre><code class=\"language-python\">#1\u3001rpm\u5305\u5728\u672c\u5730\n[root@egon ~]# mount \/dev\/sr0 \/opt\n[root@egon ~]# rpm -ivh \/opt\/minimal\/Packages\/dos2unix-7.4.2-4.el9.x86_64.rpm \n\n#2\u3001rpm\u6765\u81ea\u4e8e\u7f51\u7edc\uff0c\u5982\u679c\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u62a5\u9519\uff1acurl: (60) Peer&#039;s Certificate has expired\uff0c\u8bf7\u5148\u5c06\u7cfb\u7edf\u65f6\u95f4\u4fee\u6539\u6b63\u786e\uff0c\u7136\u540e\u518d\u5b89\u88c5\u5373\u53ef\n[root@egon ~]# rpm -ivh https:\/\/mirrors.aliyun.com\/zabbix\/zabbix\/4.0\/rhel\/7\/x86_64\/zabbix-agent-4.0.0-2.el7.x86_64.rpm  <\/code><\/pre>\n<p>\u5f53\u4f60\u4f7f\u7528 rpm -i (\u6216\u8005 &#8211;install) \u547d\u4ee4\u6765\u5b89\u88c5\u4e00\u4e2a .rpm \u7ed3\u5c3e\u7684\u5305\u65f6\uff0c\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u6267\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<br \/>\n1\u3001\u89e3\u5305\uff1a\u9996\u5148\uff0ccommand\u5f00\u59cb\u89e3\u538b.rpm\u5305\u3002\u8fd9\u4e2a\u5305\u5305\u542b\u9884\u7f16\u8bd1\u7684\u4e8c\u8fdb\u5236\u7a0b\u5e8f\u6216\u8005\u5e93\uff0c\u8fd8\u6709\u5143\u6570\u636e\u548c\u811a\u672c\u3002<br \/>\n2\u3001\u68c0\u67e5\uff1arpm\u7136\u540e\u68c0\u67e5\u65b0\u5305\uff0c\u6bd4\u5982\u770b\u770b\u8fd9\u4e2a\u5305\u6709\u6ca1\u6709\u5df2\u7ecf\u5b89\u88c5\u8fc7\uff0c\u770b\u770b\u662f\u5426\u8fd8\u6709\u5176\u4ed6\u7684\u5305\u9700\u8981\u5b89\u88c5\u6216\u8005\u5347\u7ea7\u624d\u80fd\u4f7f\u8fd9\u4e2a\u5305\u6b63\u5e38\u5de5\u4f5c\u3002\u5982\u679c\u6709\uff0c\u547d\u4ee4\u5c06\u7ed3\u675f\u5b89\u88c5\u5e76\u8fd4\u56de\u4e00\u4e2a\u9519\u8bef\u4fe1\u606f\u3002<br \/>\n3\u3001\u6587\u4ef6\u5206\u5e03\uff1a\u5982\u679c\u6761\u4ef6\u6ee1\u8db3\uff0crpm\u5c06\u628a\u5305\u4e2d\u7684\u6587\u4ef6\u590d\u5236\u5230\u8ba1\u7b97\u673a\u4e2d\u7684\u9002\u5f53\u7684\u4f4d\u7f6e\u3002\u600e\u4e48\u5206\u5e03\uff0c\u53d6\u51b3\u4e8e\u5305\u7684\u5b9a\u4e49\u3002<br \/>\n4\u3001\u811a\u672c\uff1a\u6b64\u65f6\uff0c\u53ef\u4ee5\u6309\u7167\u9700\u8981\u8fd0\u884c\u4e00\u4e9b\u811a\u672c\uff0c\u6bd4\u5982\u521d\u59cb\u5316\u914d\u7f6e\uff0c\u542f\u52a8\u670d\u52a1\u7b49\u3002<br \/>\n\u8fd9\u79cd\u5b89\u88c5\u65b9\u5f0f\uff0c\u53ea\u5b89\u88c5\u5355\u4e2aRPM\u5305\uff0c\u800c\u4e0d\u4f1a\u81ea\u52a8\u89e3\u51b3\u4f9d\u8d56\u95ee\u9898\u3002\u5982\u679c\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u6709\u4f9d\u8d56\u5173\u7cfb\uff0c\u90a3\u4e48\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u9047\u5230\u95ee\u9898\u3002\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48yum\u548cdnf\u7b49\u9ad8\u7ea7\u5305\u7ba1\u7406\u5668\u66f4\u4e3a\u5e38\u7528\uff0c\u56e0\u4e3a\u5b83\u4eec\u53ef\u4ee5\u81ea\u52a8\u89e3\u51b3\u5b83\u4eec\u7684\u4f9d\u8d56\u5173\u7cfb\u3002<\/p>\n<h3>3\u3001\u5b89\u88c5\u4e0e\u4f9d\u8d56\u6027<\/h3>\n<p>rocklinux9.3\u6848\u4f8b<\/p>\n<pre><code># \u5148\u7528\u4e00\u6761\u547d\u4ee4\u628a\u5305\u4e0b\u8f7d\u4e0b\u6765,\u8fd9\u6761\u547d\u4ee4\u5012\u4e0d\u7528\u5173\u6ce8\uff0c\u6211\u4eec\u662f\u60f3\u7528\u4e0b\u8f7d\u4e0b\u6765\u7684\u5305\u6765\u5c55\u793a\ncd \/root\/test\nyum install --downloadonly --downloaddir=.\/ nginx\n\n[root@rockylinux test]# ls\nnginx-1.20.1-14.el9_2.1.x86_64.rpm       nginx-filesystem-1.20.1-14.el9_2.1.noarch.rpm\nnginx-core-1.20.1-14.el9_2.1.x86_64.rpm  rocky-logos-httpd-90.15-2.el9.noarch.rpm\n\n[root@rockylinux test]# rpm -ivh nginx-1.20.1-14.el9_2.1.x86_64.rpm \nerror: Failed dependencies:\n    nginx-core = 1:1.20.1-14.el9_2.1 is needed by nginx-1:1.20.1-14.el9_2.1.x86_64\n    nginx-filesystem = 1:1.20.1-14.el9_2.1 is needed by nginx-1:1.20.1-14.el9_2.1.x86_64\n    system-logos-httpd is needed by nginx-1:1.20.1-14.el9_2.1.x86_64\n[root@rockylinux test]# \n\n\u62a5\u4e0a\u9762\u7684\u4f9d\u8d56\u6027\u95ee\u9898\uff0c\u6211\u4eec\u9700\u8981\u627e\u5230\u4f9d\u8d56\u5305\u5e76\u5b89\u88c5\uff0c\u800c\u4e14\u6781\u5bb9\u6613\u5728\u5b89\u88c5\u4e00\u4e2a\u4f9d\u8d56\u5305\u7684\u8fc7\u7a0b\u4e2d\u8fd8\u9700\u8981\u5176\u4ed6\u7684\u4f9d\u8d56\u5305\uff0c\u4e0b\u9762\u7684\u6b65\u9aa4\u4f60\u53ef\u4ee5\u8bd5\u7740\u6253\u4e71\u4e0b\u987a\u5e8f\u8bd5\u8bd5\u770b\n[root@rockylinux test]# rpm -ivh nginx-filesystem-1.20.1-14.el9_2.1.noarch.rpm \nVerifying...                          ################################# [100%]\nPreparing...                          ################################# [100%]\nUpdating \/ installing...\n   1:nginx-filesystem-1:1.20.1-14.el9_################################# [100%]\n[root@rockylinux test]# rpm -ivh nginx-core-1.20.1-14.el9_2.1.x86_64.rpm \nVerifying...                          ################################# [100%]\nPreparing...                          ################################# [100%]\nUpdating \/ installing...\n   1:nginx-core-1:1.20.1-14.el9_2.1   ################################# [100%]\n[root@rockylinux test]# rpm -ivh rocky-logos-httpd-90.15-2.el9.noarch.rpm \nVerifying...                          ################################# [100%]\nPreparing...                          ################################# [100%]\nUpdating \/ installing...\n   1:rocky-logos-httpd-90.15-2.el9    ################################# [100%]\n[root@rockylinux test]# \n[root@rockylinux test]# \n[root@rockylinux test]# \u89e3\u51b3\u4e86\u4f9d\u8d56\u6027\u95ee\u9898\u4e4b\u540e\uff0c\u624d\u80fd\u91cd\u65b0\u5b89\u88c5nginx\n[root@rockylinux test]# rpm -ivh nginx-1.20.1-14.el9_2.1.x86_64.rpm \nVerifying...                          ################################# [100%]\nPreparing...                          ################################# [100%]\nUpdating \/ installing...\n   1:nginx-1:1.20.1-14.el9_2.1        ################################# [100%]\n[root@rockylinux test]# <\/code><\/pre>\n<p>centos7\u6848\u4f8b<\/p>\n<pre><code class=\"language-python\">[root@egon ~]# rpm -ivh \/opt\/Packages\/httpd-2.4.6-88.el7.centos.x86_64.rpm \n\u9519\u8bef\uff1a\u4f9d\u8d56\u68c0\u6d4b\u5931\u8d25\uff1a\n    \/etc\/mime.types \u88ab httpd-2.4.6-88.el7.centos.x86_64 \u9700\u8981\n    httpd-tools = 2.4.6-88.el7.centos \u88ab httpd-2.4.6-88.el7.centos.x86_64 \u9700\u8981\n    libapr-1.so.0()(64bit) \u88ab httpd-2.4.6-88.el7.centos.x86_64 \u9700\u8981\n    libaprutil-1.so.0()(64bit) \u88ab httpd-2.4.6-88.el7.centos.x86_64 \u9700\u8981\n[root@egon ~]# \n\n# \u89e3\u51b3\u601d\u8def\uff1a\u5b89\u88c5\u63d0\u793a\u7684\u5e93\uff0c\u5b89\u88c5\n[root@egon ~]# rpm -ivh \/opt\/Packages\/apr-1.4.8-3.el7_4.1.x86_64.rpm \n[root@egon ~]# rpm -ivh \/opt\/Packages\/apr-util-1.5.2-6.el7.x86_64.rpm \n[root@egon ~]# rpm -ivh \/opt\/Packages\/httpd-tools-2.4.6-88.el7.centos.x86_64.rpm \n\n[root@egon ~]# yum search mime.types  # \u67e5\u770b\u5230mime.types\u5bf9\u5e94\u7684\u4f9d\u8d56\u5305\u4e3amailcap-\u3002\u3002\u3002\n[root@egon ~]# rpm -ivh \/opt\/Packages\/mailcap-2.1.41-2.el7.noarch.rpm \n\u7136\u540e\u91cd\u65b0\u5b89\u88c5\n[root@egon ~]# rpm -ivh \/opt\/Packages\/httpd-2.4.6-88.el7.centos.x86_64.rpm \n\u51c6\u5907\u4e2d...                          ################################# [100%]\n\u6b63\u5728\u5347\u7ea7\/\u5b89\u88c5...\n   1:httpd-2.4.6-88.el7.centos        ################################# [100%]<\/code><\/pre>\n<h3>4\u3001\u5347\u7ea7rpm\u5305<\/h3>\n<p>rokcylinux9.3<\/p>\n<pre><code>yum install libcrypto* liblber* libldap* libssl* openssl* -y\n\nwget https:\/\/mirrors.aliyun.com\/zabbix\/zabbix\/6.5\/rocky\/8\/x86_64\/zabbix-agent-7.0.0-alpha3.release1.el8.x86_64.rpm\n\nrpm -ivh zabbix-agent-7.0.0-alpha3.release1.el8.x86_64.rpm\n\nwget https:\/\/mirrors.aliyun.com\/zabbix\/zabbix\/6.5\/rocky\/9\/x86_64\/zabbix-agent-7.0.0-alpha3.release1.el9.x86_64.rpm\n\n[root@rockylinux test]# rpm -Uvh zabbix-agent-7.0.0-alpha3.release1.el9.x86_64.rpm\nwarning: zabbix-agent-7.0.0-alpha3.release1.el9.x86_64.rpm: Header V4 RSA\/SHA512 Signature, key ID 08efa7dd: NOKEY\nVerifying...                          ################################# [100%]\nPreparing...                          ################################# [100%]\nUpdating \/ installing...\n   1:zabbix-agent-7.0.0-alpha3.release################################# [ 50%]\nCleaning up \/ removing...\n   2:zabbix-agent-7.0.0-alpha3.release################################# [100%]\n[root@rockylinux test]# \n<\/code><\/pre>\n<p>centos7\u6848\u5217<\/p>\n<pre><code class=\"language-python\">#1\u3001\u4e0b\u8f7d\u4e00\u4e2a\u4f4e\u7248\u672c\u3001\u4e00\u4e2a\u9ad8\u7248\u672c\nwget https:\/\/mirrors.aliyun.com\/zabbix\/zabbix\/3.0\/rhel\/7\/x86_64\/zabbix-agent-3.0.9-1.el7.x86_64.rpm\n\nwget https:\/\/mirrors.aliyun.com\/zabbix\/zabbix\/4.2\/rhel\/7\/x86_64\/zabbix-agent-4.2.0-1.el7.x86_64.rpm\n\n#2\u3001\u5148\u5b89\u88c5\u4f4e\u7248\u672c\n[root@egon ~]# rpm -ivh zabbix-agent-3.0.9-1.el7.x86_64.rpm \n\n#3\u3001\u518d\u5b89\u88c5\u9ad8\u7248\u672c\uff0c\u4f1a\u62a5\u9519\n[root@egon ~]# rpm -ivh zabbix-agent-4.2.0-1.el7.x86_64.rpm \n\n#4\u3001\u5982\u679c\u91c7\u7528--force\u9009\u9879\uff0c\u90a3\u5c31\u662f\u5f3a\u5236\u5b89\u88c5\uff0c\u4f1a\u540c\u65f6\u5b58\u5728\u4e24\u4e2a\u7248\u672c\uff0c\u8be5\u65b9\u6848\u4e0d\u53ef\u53d6\n[root@egon ~]# rpm -qa |grep zabbix\nzabbix-agent-3.0.9-1.el7.x86_64\n[root@egon ~]# rpm -ivh zabbix-agent-4.2.0-1.el7.x86_64.rpm --force\n\u3002\u3002\u3002\u5b89\u88c5\u6210\u529f\u3002\u3002\u3002\n[root@egon ~]# rpm -qa |grep zabbix  # \u540c\u65f6\u4e24\u4e2a\u7248\u672c\u5171\u5b58\nzabbix-agent-3.0.9-1.el7.x86_64\nzabbix-agent-4.2.0-1.el7.x86_64\n\n#5\u3001\u91cd\u6765\uff0c\u91c7\u7528\u5347\u7ea7\u65b9\u5f0f\u5b89\u88c5\n[root@egon ~]# rpm -e zabbix-agent-3.0.9-1.el7.x86_64\n[root@egon ~]# rpm -e zabbix-agent-4.2.0-1.el7.x86_64\n[root@egon ~]# rpm -qa |grep zabbix\n[root@egon ~]# rpm -ivh zabbix-agent-3.0.9-1.el7.x86_64.rpm \n\u3002\u3002\u3002\n[root@egon ~]# rpm -Uvh zabbix-agent-4.2.0-1.el7.x86_64.rpm \n\u3002\u3002\u3002\u6e05\u7406\u8001\u7248\u672c\uff0c\u5b89\u88c5\u65b0\u7248\u672c\u3002\u3002\u3002\n[root@egon ~]# rpm -qa |grep zabbix-agent  # \u53ea\u7559\u4e0b\u4e00\u4e2a\u65b0\u7248\u672c\nzabbix-agent-4.2.0-1.el7.x86_64\n[root@egon ~]# <\/code><\/pre>\n<h3>5\u3001\u7ec3\u4e60\u5b89\u88c5\u5982\u4e0b\u8f6f\u4ef6\u5305\uff1a<\/h3>\n<pre><code class=\"language-python\">vsftpd \nsamba \nnfs-utils \nhttpd \ndhcp \npostfix \nphp\nlftp\ndos2unix\nunix2dos\ntigervnc <\/code><\/pre>\n<h2>\u56db yum\u7ba1\u7406RPM\u5305<\/h2>\n<h3>1\u3001yum\u4ecb\u7ecd<\/h3>\n<p>yum\u81ea\u52a8\u89e3\u51b3\u4f9d\u8d56\u5173\u7cfb<\/p>\n<p>Yum\uff08\u5168\u79f0\u4e3a Yellow dog Updater, Modified\uff09\u662f\u4e00\u4e2a\u5728Fedora\u548cRedHat\u4ee5\u53caCentOS\u4e2d\u7684Shell\u524d\u7aef\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u3002\u57fa\u4e8eRPM\u5305\u7ba1\u7406\uff0c\u80fd\u591f\u4ece\u6307\u5b9a\u7684\u670d\u52a1\u5668\u81ea\u52a8\u4e0b\u8f7dRPM\u5305\u5e76\u4e14\u5b89\u88c5\uff0c\u53ef\u4ee5\u81ea\u52a8\u5904\u7406\u4f9d\u8d56\u6027\u5173\u7cfb\uff0c\u5e76\u4e14\u4e00\u6b21\u5b89\u88c5\u6240\u6709\u4f9d\u8d56\u7684\u8f6f\u4ef6\u5305\uff0c\u65e0\u987b\u7e41\u7410\u5730\u4e00\u6b21\u6b21\u4e0b\u8f7d\u3001\u5b89\u88c5\u3002<\/p>\n<p>\u6ce8\u610f\uff1a\u5728rockylinux9.3\u4e2d\uff0cyum\u547d\u4ee4\u94fe\u63a5\u5230\u4e86dnf\u4e0a\uff0c\u5373\u5728rockyLinux9.3\u4e2d\u771f\u6b63\u7528\u7684\u662fdnf<\/p>\n<pre><code>[root@rockylinux ~]# ll \/usr\/bin\/yum \nlrwxrwxrwx. 1 root root 5 Nov  1 09:53 \/usr\/bin\/yum -&gt; dnf-3\n[root@rockylinux ~]# ll \/usr\/bin\/dnf\nlrwxrwxrwx. 1 root root 5 Nov  1 09:53 \/usr\/bin\/dnf -&gt; dnf-3\n\nDNF\uff08Dandified Yum\uff09\uff0c\u5b83\u662f Yum\uff08Yellowdog Updater, Modified\uff09\u7684\u4e0b\u4e00\u4ee3\u7248\u672c\u3002\nDNF \u76f8\u6bd4\u4e8e \u4e4b\u524d\u7684Yum \u5177\u6709\u66f4\u597d\u7684\u6027\u80fd\uff0c\u89e3\u51b3\u4f9d\u8d56\u5173\u7cfb\u66f4\u52a0\u7cbe\u51c6\u4e14\u4f7f\u7528\u66f4\u65b9\u4fbf\uff0c\u8fd9\u5c31\u662f Rocky Linux \u9009\u62e9\u5b83\u4f5c\u4e3a\u65b0\u5305\u7ba1\u7406\u5de5\u5177\u7684\u539f\u56e0\u3002\n\n\u8f6f\u8fde\u63a5\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u5bf9\u4f60\u5c4f\u853d\u6389\u8fd9\u79cd\u6539\u52a8\uff0c\u5927\u591a\u6570\u5305\u62ecyum\u6e90\u914d\u7f6e\u65b9\u6cd5\u90fd\u662f\u4e00\u6837\u7684\n<\/code><\/pre>\n<p>\u4e0b\u9762\u4ecb\u7ecd\u7684\u7528\u6cd5\uff0ccentos7\u3001rockylinux9.3\u5b8c\u5168\u4e00\u81f4\uff0c\u653e\u5fc3\u7528\u5c31\u884c<\/p>\n<pre><code>\u4f60\u4e5f\u53ef\u4ee5\u5728rockylinux9.3\u4e2dman dnf\u770b\u4e00\u4e0b\uff0c\u4f60\u62c9\u5230\u672b\u5c3e\u4f1a\u770b\u5230dnf\u76f8\u5173\u914d\u7f6e\nFILES\n       Cache Files\n              \/var\/cache\/dnf\n\n       Main Configuration\n              \/etc\/dnf\/dnf.conf\n\n       Repository\n              \/etc\/yum.repos.d\/\n\n\u4f60\nll \/etc\/yum.conf\u4f1a\u53d1\u73b0\u76f4\u63a5\u5c31\u662f\u94fe\u63a5\u5230\u4e86\/etc\/dnf\/dnf.conf\u4e0a\n[root@rockylinux ~]# ll \/etc\/yum.conf \nlrwxrwxrwx. 1 root root 12 Nov  1 09:53 \/etc\/yum.conf -&gt; dnf\/dnf.conf\n<\/code><\/pre>\n<h3>2\u3001yum\u547d\u4ee4\u4e0e\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u65e0\u8bba\u662fcentos7\u8fd8\u662frockylinux9.3\u4f60\u90fd\u53ef\u4ee5\u5728\u8fd9\u91cc\u914d\u7f6eyum\u914d\u7f6e<br \/>\n\/etc\/yum.conf # rpm -qc yum<br \/>\n\u4f8b\u5982\u4f60\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u914d\u7f6e\u5c06yum install\u7684\u5305\u90fd\u7f13\u5b58\u5230\u672c\u5730\u67d0\u4e2a\u6587\u4ef6\u5939\u4e0b<\/p>\n<pre><code>\u9ed8\u8ba4\u662f\uff1a \/var\/cache\/yum\n\u4e5f\u53ef\u4ee5\u5728 \/etc\/yum.conf \u6307\u5b9a\ncachedir=\/var\/cache\/yum #\u5b58\u653e\u76ee\u5f55\nkeepcache=1 \uff031\u4e3a\u4fdd\u5b58 0\u4e3a\u4e0d\u4fdd\u5b58\nmetadata_expire=1800 \uff03\u8fc7\u671f\u65f6\u95f4<\/code><\/pre>\n<h3>3\u3001yum\u547d\u4ee4\u5e38\u7528\u9009\u9879<\/h3>\n<pre><code class=\"language-python\">\u5e38\u7528\u9009\u9879\u8bf4\u660e\uff1a\n#\u4ed3\u5e93        \n            yum repolist                     # \u67e5\u8be2\u53ef\u7528\u4ed3\u5e93\n            yum repolist all                 #\u67e5\u770b\u5305\u62ec\u5df2\u542f\u7528\u6216\u7981\u7528\u7684\u6240\u6709\u4ed3\u5e93\u72b6\u6001\n\n            # (centos7.9)\u5173\u95ed\u4e0e\u542f\u7528\u4ed3\u5e93\uff1a\u672c\u8d28:\u90fd\u662f\u5728\u4fee\u6539repo\u6587\u4ef6\u4e2d\u7684enable\u7684\u503c 0 \u4e0d\u542f\u7528 1 \u542f\u7528\n            yum-config-manager --disable epel        #\u5173\u95ed\u4ed3\u5e93epel\n            yum-config-manager --enable epel         #\u542f\u7528\u4ed3\u5e93epel\n\n#\u67e5\u770b        \n            yum list                        #\u5217\u51fa\u53ef\u7528\u4ed3\u5e93\u4e2d\u6240\u6709\u7684\u8f6f\u4ef6\u5305\n            yum list | less\n            yum grouplist                   #\u5217\u51fa\u53ef\u7528\u4ed3\u5e93\u4e2d\u7684\u8f6f\u4ef6\u7ec4\n\n            yum provides \/usr\/sbin\/ifconfig   #\u67e5\u8be2\u547d\u4ee4\u6240\u5c5e\u7684\u8f6f\u4ef6\u5305\uff0c\u53ef\u4ee5\u4e0d\u52a0\u8def\u5f84\uff0c\u53ea\u5199\u547d\u4ee4\u540d\u5b57\n                                              #\u4e0erpm -qf\u7684\u533a\u522b\u5728\u4e8eyum provides\u540e\u53ef\u4ee5\u53ea\u8ddf\u547d\u540d\u540d\n\n#\u5b89\u88c5        yum install httpd httpd-tools  #\u52a0\u4e0a-y\u9009\u9879\u53ef\u4ee5\u53d8\u6210\u975e\u4ea4\u4e92\n            yum groupinstall &quot;\u5f00\u53d1\u5de5\u5177&quot; -y   #\u5b89\u88c5\u8f6f\u4ef6\u7ec4\uff0c\u4e00\u4e2a\u8f6f\u4ef6\u7ec4\u4e2d\u5305\u542b\u4e86\u591a\u4e2a\u8f6f\u4ef6\u5305\n            yum groups install &quot;\u5f00\u53d1\u5de5\u5177&quot; -y   #\u540c\u4e0a\n\n#\u5378\u8f7d        yum remove httpd httpd-tools http*  #\u5378\u8f7d\u8f6f\u4ef6\u5305\n            yum groupremove &quot;\u5f00\u53d1\u5de5\u5177&quot; -y.       #\u5378\u8f7d\u8f6f\u4ef6\u7ec4\n            yum groups remove &quot;\u5f00\u53d1\u5de5\u5177&quot; -y      #\u540c\u4e0a\n\n#\u91cd\u88c5        yum reinstall httpd             #\u4e0d\u5c0f\u5fc3\u5220\u9664\u4e86\u914d\u7f6e\u6587\u4ef6\u7684\u65f6,\u53ef\u4ee5reinstall\u4e00\u4e0b\n\n#\u66f4\u65b0        yum check-update                 #\u68c0\u67e5\u53ef\u4ee5\u66f4\u65b0\u7684\u8f6f\u4ef6\u5305\n\n            yum update -y                    #\u66f4\u65b0\u6240\u6709\u8f6f\u4ef6\u5305,\u5305\u62ec\u5185\u6838,\u901a\u5e38\u53ea\u5728\u521a\u88c5\u5b8c\u7cfb\u7edf\u65f6\u6267\u884c\n\n            yum update httpd -y              #\u66f4\u65b0\u67d0\u4e2a\u8f6f\u4ef6\u5305\n\n            \u5728 CentOS 7 \u4e2d\uff0cyum update \u548c yum upgrade \n            1\u3001\u76f8\u540c\u70b9\uff1a\u90fd\u4f1a\u66f4\u65b0\u6240\u6709\u5305\uff08\u5305\u62ec\u8f6f\u4ef6\u4e0e\u5185\u6838\uff09\n            2\u3001\u4e0d\u540c\u70b9\n            yum update\u66f4\u65b0\u7684\u65f6\u5019\u4f1a\u4fdd\u7559\u8fc7\u65f6\u7684\u5305\uff0c\u8fd9\u5bf9\u4f9d\u8d56\u8001\u5305\u7684\u5e94\u7528\u5f88\u53cb\u597d\n            yum upgrade\u66f4\u65b0\u7684\u65f6\u5019\u4f1a\u5220\u9664\u8fc7\u65f6\u7684\u5305\uff0c\u5982\u679c\u4f60\u7cfb\u7edf\u4e2d\u6240\u6709\u7684\u5e94\u7528\u5168\u90fd\u4e3arpm\n            \u5305\uff0c\u90a3upgrade\u5012\u662f\u4e0d\u4f1a\u5bf9\u4f60\u6709\u5f71\u54cd\uff0c\u56e0\u4e3a\u90fd\u4f1a\u4e00\u8d77\u8ddf\u7740\u66f4\u65b0\u3002\u4f46\u662f\u5982\u679c\u4f60\n            \u5b89\u88c5\u7684\u5305\u91cc\u6709\u81ea\u5df1\u7f16\u8bd1\u5b89\u88c5\u7684\uff0c\u800c\u7f16\u8bd1\u5b89\u88c5\u7684\u5305\u4f1a\u4f9d\u8d56\u67d0\u4e2a\u7279\u5b9a\u7248\u672c\u7684rpm\u5305\n            \u90a3upgrade\u5347\u7ea7\u4e4b\u540e\uff0c\u5f88\u6709\u53ef\u80fd\u4f1a\u9020\u6210\u4f60\u7f16\u8bd1\u5b89\u88c5\u5305\u7684\u4e0d\u53ef\u7528\n\n            \u7efc\u4e0a\uff0c\u5982\u679c\u662f\u521a\u88c5\u7cfb\u7edf\uff0c\u90a3\u5c31\u7528upgrade\uff0c\u5426\u5219\u8fd8\u662f\u7528update\u9760\u8c31\u4e9b\n\n            \u5728rockylinux\u4e2d\uff0cyum\u547d\u4ee4\u90fd\u94fe\u63a5\u5230\u4e86dnf-3\u4e0a\n            \u800c\u5728 DNF \u4e2d\uff0c\uff0c\u5728dnf-3\u4e2d\uff0cdnf update \u4e0e dnf upgrade \u662f\u6ca1\u6709\u533a\u522b\u7684\u3002\n            \u5177\u4f53\u800c\u8a00\uff0c\u4e24\u8005\u90fd\u662f\u7528\u4e8e\u66f4\u65b0\u7cfb\u7edf\u4e0a\u5df2\u7ecf\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u5230\u6700\u65b0\u53ef\u7528\u7248\u672c\n\n#\u7f13\u5b58              \n            yum makecache                    #\u5236\u4f5c\u5143\u6570\u636e\u7f13\u5b58\uff0c\u5e76\u4e0d\u4f1a\u4e0b\u8f7d\u5305\n            yum clean all                    #\u6e05\u7406\u7f13\u5b58\uff0c\u4f60\u5982\u679c\u5728yum.conf\u914d\u7f6e\u7684keepcache\uff0c\u4e4b\u524d\u7f13\u5b58\u7684\u5305\u90fd\u4f1a\u6e05\u7a7a\n            vim \/etc\/yum.conf                #\u9ed8\u8ba4\u8f6f\u4ef6\u5305\u4e0b\u8f7d\u5b89\u88c5\u540e\u4f1a\u81ea\u52a8\u5220\u9664\n                                             #\u8bbe\u7f6ekeepcache=1 \u5373\u5f00\u542f\u4e86\u8f6f\u4ef6\u5305\u7f13\u5b58\n                                             #\u7f13\u5b58\u76ee\u5f55\u4e3a\u914d\u7f6e\u6587\u4ef6\u4e2d\u6307\u5b9a\u7684cachedir\n\n#\u5386\u53f2\u8bb0\u5f55\n           yum history                       # \u67e5\u770b\u6267\u884c\u8fc7\u7684yum\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\n           yum history info ID\u53f7             # \u67e5\u770b\u5177\u4f53\u67d0\u4e00\u6761yum\u547d\u4ee4\u7684\u8be6\u7ec6\u4fe1\u606f\n           yum history undo ID\u53f7             # \u64a4\u9500\u6267\u884c\u8fc7\u7684\u5386\u53f2\u547d\u4ee4\n\n# \u5173\u4e8e\u5b89\u88c5\u9700\u8981\u6ce8\u610f\uff1a\n\u65e0\u8bbayum\u5b89\u88c5\u7684\u8f6f\u4ef6\u6765\u81ea\u4f55\u65b9\uff0cyum\u65f6\u523b\u4ee5\u81ea\u5df1\u4ed3\u5e93\u4e2d\u7684repodata\u5b58\u50a8\u7684\u4f9d\u8d56\u5173\u7cfb\u4e3a\u51c6\uff0c\u5982\u679c\u6709\u591a\u4e2a\u4ed3\u5e93\uff0c\u5c31\u4f9d\u6b21\u68c0\u7d22\n#1\u3001yum\u76f4\u63a5\u5b89\u88c5\u516c\u7f51\u7684rpm\u5305, \u4f1a\u81ea\u52a8\u67e5\u627e\u5f53\u524d\u7cfb\u7edf\u4e0a\u5df2\u6709\u7684\u4ed3\u5e93\u89e3\u51b3\u4f9d\u8d56\u5173\u7cfb\nyum install https:\/\/mirrors.aliyun.com\/centos\/7.9.2009\/os\/x86_64\/Packages\/samba-4.10.16-5.el7.x86_64.rpm\n\n#2\u3001Yum\u76f4\u63a5\u5b89\u88c5\u672c\u5730\u7684rpm\u5305,\u4f1a\u81ea\u52a8\u67e5\u627e\u5f53\u524d\u7cfb\u7edf\u4e0a\u5df2\u6709\u7684\u4ed3\u5e93\u89e3\u51b3\u4f9d\u8d56\u5173\u7cfb\nyum localinstall -y \/mnt\/Packages\/httpd-2.4.6-88.el7.centos.x86_64.rpm<\/code><\/pre>\n<p>\u8981\u4f7f\u7528yum\u524d,\u9700\u8981\u51c6\u5907\u4e00\u4e2ayum\u6e90(\u6211\u4eec\u4e5f\u79f0\u4e3ayum\u4ed3\u5e93), \u8fd9\u4e2a\u53ef\u4ee5\u662f\u4e00\u4e2a\u4e92\u8054\u7f51\u4e0a\u7684\u4ed3\u5e93,\u4e5f\u53ef\u4ee5\u662f\u672c\u5730\u81ea\u5df1\u642d\u5efa\u7684\u4ed3\u5e93.\u4ed3\u5e93\u91cc\u9762\u6709\u4ec0\u4e48\u5462?\u91cc\u9762\u5168\u90e8\u90fd\u662f.rpm\u7684\u8f6f\u4ef6\u5305.\u4e00\u53f0linux,\u53ef\u4ee5\u6dfb\u52a0N\u591a\u4e2ayum\u6e90, \u80fd\u641c\u7d22\u7684\u8f6f\u4ef6\u5305\u6570\u91cf\u5c31\u662fN\u4e2ayum\u6e90\u4e4b\u548c.<\/p>\n<p>\u7cfb\u7edf\u5e38\u89c1yum\u6e90<\/p>\n<pre><code class=\"language-python\">1.\u81ea\u5b9a\u4e49\u7684\u672c\u5730\u6e90\n\n2.\u7f51\u7edc\u4e0a\u7684\u6e90\u5934\uff0c\u5982\uff1abase\u57fa\u7840\u6e90\u3001epel\u6269\u5c55\u6e90\u3001\u4e0e\u670d\u52a1\u76f8\u5173\u7684\u6e90(\u5b98\u7f51)<\/code><\/pre>\n<h3>4\u3001\u955c\u50cf\u6587\u4ef6\u4f5c\u4e3ayum\u6e90\uff08\u672c\u5730\u6e90\uff09<\/h3>\n<h4>1.\u5148\u6302\u8f7d<\/h4>\n<pre><code class=\"language-python\"># \u65b9\u5f0f1\uff1a\n[root@localhost ~]# mount \/dev\/cdrom \/opt\/\n\n# \u65b9\u5f0f2\uff1a\n[root@localhost ~]# mount \/dev\/sr0 \/opt\/\n\n# \u65b9\u5f0f3\n[root@localhost ~]# mount -o loop \/xxx.iso \/opt\n\n\u67e5\u770b\u5149\u76d8\u91cc\u7684rpm\u5305\n[root@localhost ~]# ls \/opt\/Packages\/ <\/code><\/pre>\n<h4>2.\u7f16\u8f91repo\u6587\u4ef6<\/h4>\n<p>\u5f3a\u8c03\uff1abaseurl\u6307\u5b9a\u7684\u76ee\u6807\u8def\u5f84\u4e0b\u5fc5\u987b\u6709\u7528\u4e00\u4e2arepodata\u76ee\u5f55\uff0c\u91cc\u9762\u5b58\u653e\u7740\u5305\u95f4\u7684\u4f9d\u8d56\u6027\u5173\u7cfb\uff0c\u662fyum\u89e3\u51b3\u4f9d\u8d56\u6027\u95ee\u9898\u7684\u5173\u952e<br \/>\ncentos7.9\u955c\u50cf\u6302\u8f7d\u5230\u4e86\/opt\u4e0b\uff0c\u4f46repodata\u5c31\u5728\/opt<br \/>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/image-1710596992371.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/image-1710596992371.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"file\" \/><\/div><br \/>\ncentos9.3\u955c\u50cf\u6302\u8f7d\u5230\u4e86\/opt\u4e0b\uff0c\u4f46repodata\u5728\/opt\/minimal\u4e0b<br \/>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/image-1710596916808.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/image-1710596916808.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"file\" \/><\/div><\/p>\n<pre><code class=\"language-python\">[root@localhost ~]# cd \/etc\/yum.repos.d\/\n[root@localhost yum.repos.d]# vim local.repo  # \u6587\u4ef6\u540d\u81ea\u5b9a\u4e49\uff0c\u5fc5\u987b\u4ee5.repo\u7ed3\u5c3e\n[local]  # \u4ed3\u5e93\u7684\u5b9e\u9645\u540d\u5b57,\u4efb\u610f\nname=local # \u4ed3\u5e93\u7684\u63cf\u8ff0\uff0c\u4efb\u610f\nbaseurl=file:\/\/\/opt  # \u4ed3\u5e93\u4f4d\u7f6e,\u53ef\u4ee5\u662f http:\/\/ https:\/\/ ftp:\/\/ file:\/\/\nenabled=1  # \u542f\u7528\u4ed3\u5e93\uff0c\u9ed8\u8ba4\u5c31\u662f\u542f\u7528\u7684\ngpgcheck=0 # \u68c0\u67e5\u5b89\u88c5\u7684rpm\u662f\u5426\u662f\u5408\u6cd5\u7684\uff0c0\u8868\u793a\u4e0d\u68c0\u9a8c<\/code><\/pre>\n<h4>3.\u68c0\u67e5\u53ef\u7528\u4ed3\u5e93<\/h4>\n<pre><code class=\"language-python\">[root@localhost ~]# yum repolist     # \u67e5\u8be2\u53ef\u7528\u4ed3\u5e93\n[root@localhost ~]# yum repolist all # \u67e5\u770b\u6240\u6709\u4ed3\u5e93\uff0c\u5305\u62ec\u7981\u7528\u7684<\/code><\/pre>\n<h4>4.\u5b89\u88c5\u3001\u67e5\u8be2\u3001\u5378\u8f7d<\/h4>\n<pre><code class=\"language-python\">[root@localhost ~]# yum list         # \u5217\u51fa\u53ef\u7528\u7684\u8f6f\u5305\n[root@localhost ~]# yum install vsftpd -y \n[root@localhost ~]# yum list vsftpd httpd\n[root@localhost ~]# yum remove vsftpd -y\n\n[root@localhost ~]# yum install glib* httpd -y \n[root@localhost ~]# yum provides vsftp  # \u67e5\u8be2\u67d0\u4e2a\u8f6f\u4ef6\uff08\u53ef\u4ee5\u662f\u672a\u5b89\u88c5\u7684\uff09\u662f\u7531\u54ea\u4e2arpm\u5305\u63d0\u4f9b\n\n# yum reinstall\n[root@egon ~]# rm -rf \/etc\/httpd\/conf\/httpd.conf \n[root@egon ~]# yum reinstall httpd -y &> \/dev\/null\n[root@egon ~]# ls \/etc\/httpd\/conf\/httpd.conf \n\/etc\/httpd\/conf\/httpd.conf\n\n# yum update\n[root@localhost ~]# yum -y update samba\n[root@localhost ~]# yum -y update <\/code><\/pre>\n<h4>5.\u8f6f\u4ef6\u5305\u7ec4\u5b89\u88c5\u3001\u67e5\u8be2\u3001\u5378\u8f7d<\/h4>\n<pre><code class=\"language-python\">[root@localhost ~]# yum grouplist\n[root@localhost ~]# yum groupinstall &quot;GNOME \u684c\u9762&quot; -y\n[root@egon ~]# yum groupinstall &quot;\u5f00\u53d1\u5de5\u5177&quot; -y\n[root@egon ~]# yum groupremove &quot;\u5f00\u53d1\u5de5\u5177&quot; -y<\/code><\/pre>\n<h3>5\u3001\u4f7f\u7528\u5f00\u6e90yum\u6e90\uff08\u7f51\u7edc\u6e90\uff09<\/h3>\n<h4>1\u3001\u4e3ayum\u4e0b\u8f7d\u5f00\u6e90\u7684Base\u6e90\uff1a<\/h4>\n<p>Base\u6e90\u91cc\u653e\u7740\u5f88\u591a\u4f9d\u8d56\u7684\u57fa\u7840\u5305<\/p>\n<p>\u4f8b\u5982\u963f\u91cc\u4e91\u7684Base\u57fa\u7840\u6e90<\/p>\n<pre><code class=\"language-python\">wget -O \/etc\/yum.repos.d\/CentOS-Base.repo http:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo<\/code><\/pre>\n<h4>2.\u4f8b\u5982163\u7684Base\u57fa\u7840\u6e90<\/h4>\n<pre><code class=\"language-python\">wget -O \/etc\/yum.repos.d\/CentOS-Base.repo http:\/\/mirrors.163.com\/.help\/CentOS7-Base-163.repo<\/code><\/pre>\n<h4>3.\u4f8b\u5982\u7ea2\u5e3d\u7684epel\u6269\u5c55\u6e90<\/h4>\n<pre><code class=\"language-python\"># \u53ef\u4ee5\u76f4\u63a5\u4e0b\u8f7d\n[root@egon ~]# curl -o  \/etc\/yum.repos.d\/epel.repo http:\/\/mirrors.aliyun.com\/repo\/epel-7.repo\n# \u4e5f\u53ef\u4ee5\u5b89\u88c5\u4e00\u4e2a\u8f6f\u4ef6\u5305\u6765\u751f\u6210\n[root@egon ~]# yum install epel-release -y  # \n\nEPEL\u7684\u5168\u79f0\u53eb Extra Packages for Enterprise Linux \u3002EPEL\u662f\u7531 Fedora \u793e\u533a\u6253\u9020\uff0c\u4e3a RHEL \u53ca\u884d\u751f\u53d1\u884c\u7248\u5982 CentOS\u3001Scientific Linux \u7b49\u63d0\u4f9b\u9ad8\u8d28\u91cf\u8f6f\u4ef6\u5305\u7684\u9879\u76ee\u3002\u88c5\u4e0a\u4e86 EPEL\u4e4b\u540e\uff0c\u5c31\u76f8\u5f53\u4e8e\u6dfb\u52a0\u4e86\u4e00\u4e2a\u7b2c\u4e09\u65b9\u6e90\u3002\n\nRHEL\u4ee5\u53ca\u4ed6\u7684\u884d\u751f\u53d1\u884c\u7248\u5982CentOS\u3001Scientific Linux\u4e3a\u4e86\u7a33\u5b9a\uff0c\u5b98\u65b9\u7684rpm repository\u63d0\u4f9b\u7684rpm\u5305\u5f80\u5f80\u662f\u5f88\u6ede\u540e\u7684\uff0c\u5f53\u7136\u4e86\uff0c\u8fd9\u6837\u505a\u8fd9\u662f\u65e0\u53ef\u539a\u975e\u7684\uff0c\u6bd5\u7adf\u8fd9\u662f\u670d\u52a1\u5668\u7248\u672c\uff0c\u5b89\u5168\u7a33\u5b9a\u662f\u91cd\u70b9\uff0c\u5b98\u65b9\u7684rpm repository\u63d0\u4f9b\u7684rpm\u5305\u4e5f\u4e0d\u591f\u4e30\u5bcc\uff0c\u5f88\u591a\u65f6\u5019\u9700\u8981\u81ea\u5df1\u7f16\u8bd1\u90a3\u592a\u8f9b\u82e6\u4e86\uff0c\u800cEPEL\u6070\u6070\u53ef\u4ee5\u89e3\u51b3\u8fd9\u4e24\u65b9\u9762\u7684\u95ee\u9898\u3002<\/code><\/pre>\n<h4>4.\u4f7f\u7528nginx\u5b98\u7f51\u7684\u8f6f\u4ef6\u5305\u6e90<\/h4>\n<p>nginx\u7684\u6e90\u91cc\u653e\u7740nginx\u76f8\u5173\u7684\u5305\uff0c\u4f46\u662f\u4e00\u4e9b\u57fa\u7840\u7684\u4f9d\u8d56\u5305\u8fd8\u662f\u9700\u8981\u4eceBase\u6e90\u91cc\u62ff\uff0c\u6240\u4ee5\u9700\u8981\u914d\u7f6e\u4f7f\u7528<br \/>\n<a href=\"https:\/\/nginx.org\/\">https:\/\/nginx.org\/<\/a><\/p>\n<pre><code class=\"language-python\"># \u8fdb\u5165nginx\u5b98\u7f51-&gt;download-&gt;Pre-Built Packages-&gt;Stable and mainline-&gt;RHEL\/CentOS-&gt;\u7f16\u8f91\u5230\u672c\u5730\n\n[root@egon yum.repos.d]# cat nginx.repo \n[nginx-stable]\nname=nginx stable repo\nbaseurl=http:\/\/nginx.org\/packages\/centos\/$releasever\/$basearch\/\ngpgcheck=1\nenabled=1\ngpgkey=https:\/\/nginx.org\/keys\/nginx_signing.key\nmodule_hotfixes=true\n\n[nginx-mainline]\nname=nginx mainline repo\nbaseurl=http:\/\/nginx.org\/packages\/mainline\/centos\/$releasever\/$basearch\/\ngpgcheck=1\nenabled=0\ngpgkey=https:\/\/nginx.org\/keys\/nginx_signing.key\nmodule_hotfixes=true\n[root@egon yum.repos.d]# <\/code><\/pre>\n<h4>5.\u5c06Centos\u7cfb\u7edf\u9ed8\u8ba4\u7684\u6e90\u5907\u4efd<\/h4>\n<pre><code class=\"language-python\">[root@egon ~]# cd \/etc\/yum.repos.d\/\n[root@egon yum.repos.d]# mkdir bak\n[root@egon yum.repos.d]# mv CentOS-* bak\/\n[root@egon yum.repos.d]# ls\nbak  CentOS-Base.repo  epel.repo  local.repo  nginx.repo\n[root@egon yum.repos.d]# \n<\/code><\/pre>\n<h3>6\u3001 \u81ea\u5df1\u5236\u4f5c\u672c\u5730yum\u6e90<\/h3>\n<h4>1.\u4e0b\u8f7d\u597d\u4e00\u5806rpm\u5305\uff0c\u76f8\u5173\u4f9d\u8d56\u5305\u4e5f\u90fd\u5b58\u5728\uff0c\u5c06\u6240\u6709\u7684rpm\u5305\u90fd\u653e\u7f6e\u4e8e\u4e00\u4e2a\u6587\u4ef6\u5939\u4e0b\uff0c\u6bd4\u5982\/aaa<\/h4>\n<h4>2.\u5b89\u88c5\u5de5\u5177createrepo<\/h4>\n<pre><code class=\"language-python\">[root@localhost ~]# yum install createrepo -y<\/code><\/pre>\n<h4>3.\u5236\u4f5crepodata<\/h4>\n<pre><code class=\"language-python\">[root@localhost ~]# createrepo \/aaa\/<\/code><\/pre>\n<h4>4.\u914d\u7f6e\u672c\u5730repo\u6587\u4ef6,\u6307\u5411\/aaa<\/h4>\n<pre><code class=\"language-python\">[root@localhost ~]# vim \/etc\/yum.repos.d\/soft.repo\n[soft]\nname=soft\nbaseurl=file:\/\/\/aaa\nenabled=1\ngpgcheck=0<\/code><\/pre>\n<h4>5.<strong>yum\u6269\u5c55\u77e5\u8bc6<\/strong><\/h4>\n<h5>1\uff09yum\u5143\u6570\u636e\u7f13\u5b58\uff1a\u6307\u7684\u5c06yum\u4ed3\u5e93\u7684\u5143\u6570\u636e\u7f13\u5b58\u4e0b\u6765\uff0c\u4e0b\u6b21\u5b89\u88c5\u65f6\u7701\u53bb\u4e86\u68c0\u7d22\u8fc7\u7a0b\uff0c\u5b89\u88c5\u901f\u5ea6\u53ef\u4ee5\u52a0\u5feb<\/h5>\n<pre><code class=\"language-python\">[root@localhost ~]# yum clean all  # \u6e05\u7406\u7f13\u5b58\n[root@localhost ~]# yum makecache  # \u5236\u4f5c\u7f13\u5b58<\/code><\/pre>\n<h5>2\uff09yum\u8f6f\u4ef6\u5305\u7f13\u5b58\uff1a\u5f00\u542f\u8f6f\u4ef6\u5305\u7f13\u5b58\u540e\uff0c\u4ece\u7f51\u7edc\u6e90\u4e0b\u8f7d\u5b89\u88c5\u5b8c\u7684\u8f6f\u4ef6\u5b89\u88c5\u5305\u4e0d\u518d\u5220\u9664\uff0c\u90fd\u7f13\u5b58\u5230\u4e86\u672c\u5730\uff0c<\/h5>\n<pre><code class=\"language-python\">[root@localhost ~]# vim \/etc\/yum.conf\n[main]\ncachedir=\/var\/cache\/yum\/$basearch\/$releasever  # \u6307\u5b9a\u8f6f\u4ef6\u5b89\u88c5\u5305\u7684\u7f13\u5b58\u76ee\u5f55\nkeepcache=1  # \u8bbe\u7f6e\u4e3a1\ndebuglevel=2\n\n# \u7f13\u5b58\u76ee\u5f55\u4e3a\uff1als \/var\/cache\/yum\/x86_64\/7\/<\/code><\/pre>\n<h5>3\uff09\u57fa\u4e8e\u8f6f\u4ef6\u5305\u7f13\u5b58\uff0c\u53ef\u4ee5\u505a\u6210\u81ea\u5df1\u7684yum\u6e90\uff0c\u4ee5\u6b64\u6765\u63a7\u5236\u5404\u4e2a\u670d\u52a1\u7684\u7248\u672c\uff0c\u901a\u5e38\u7684\u505a\u6cd5\u4e3a<\/h5>\n<pre><code class=\"language-python\"># 1\u3001\u5728\u6d4b\u8bd5\u73af\u5883\u4e2d\uff0c\u5728\u6bcf\u4e2a\u8282\u70b9\u4e0a\u90fd\u5f00\u542f\u8f6f\u4ef6\u5305\u7f13\u5b58\n# 2\u3001\u5728\u6d4b\u8bd5\u73af\u5883\u4e2d\uff0c\u5b89\u88c5\u76f8\u540c\u7248\u672c\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b89\u88c5\u5b8c\u6bd5\u540e\u7edf\u4e00\u6267\u884cyum update -y \n# 3\u3001\u5728\u6d4b\u8bd5\u73af\u5883\u4e2d\uff0c\u90e8\u7f72\u5b8c\u5b8c\u4f60\u7684\u67b6\u6784\uff0c\u6d4b\u8bd5\u5b8c\u6bd5\n# 4\u3001\u628a\u6d4b\u8bd5\u73af\u5883\u4e2d\u6bcf\u53f0\u673a\u5668\u4e0a\u7f13\u5b58\u597d\u7684\u8f6f\u4ef6\u5305\u5b89\u88c5\u5305\u91c7\u96c6\u5230\u4e00\u4e2a\u6587\u4ef6\u4e0b\n[root@egon ~]# find \/var\/cache\/yum\/x86_64\/7\/ -type f -name &quot;*.rpm&quot; | xargs -I {} mv {} \/soft\/\n\n# 5\u3001\u7136\u540e\u7528createrepo\u547d\u4ee4\u5236\u4f5c\u597d\u4f9d\u8d56\u5173\u7cfb\uff0c\u5373repodata\u6570\u636e\u5e93\n# 6\u3001\u7136\u540e\u5728\u7ebf\u4e0a\u73af\u5883\u90e8\u7f72\u65f6,\u5c31\u7528\u8be5\u672c\u5730\u6e90\u5c31\u597d\uff0c\u4e0d\u8981\u8f7b\u6613\u5347\u7ea7\uff0c\u4e0d\u8981\u6ee5\u7528yum\u6e90\uff0c\u8fd9\u6837\u53ef\u4ee5\u4e25\u683c\u63a7\u5236\u597d\u5404\u4e2a\u670d\u52a1\u7684\u7248\u672c<\/code><\/pre>\n<h3>7\u3001 \u81ea\u5df1\u5236\u4f5c\u672c\u5730yum\u6e90\u5171\u4eab\u7ed9\u522b\u4eba<\/h3>\n<pre><code class=\"language-python\">==================\u5728\u670d\u52a1\u7aef\u4e0a\u6267\u884c\u5982\u4e0b\u64cd\u4f5c==================\n# 1\u3001\u73af\u5883\u51c6\u5907\n[root@egon ~]# systemctl stop firewalld\n[root@egon ~]# systemctl disable firewalld\n[root@egon ~]# setenforce 0\n[root@egon ~]# sed -i &#039;s#^SELINUX=.*#SELINUX=disabled#g&#039; \/etc\/selinux\/config   \n\n# 2\u3001\u5b89\u88c5ftp\u670d\u52a1\n[root@egon ~]# yum install vsftpd -y  \n[root@egon ~]# systemctl start vsftpd\n[root@egon ~]# systemctl status vsftpd # \u67e5\u770b\u72b6\u6001\uff0c\u786e\u4fdd\u5f00\u542f\uff0c\u9ed8\u8ba4\u5171\u4eab\u8def\u5f84\/var\/ftp\u4e0b\u7684\u76ee\u5f55\n[root@egon ~]# systemctl enable vsftpd #\n\n# 3\u3001\u91c7\u96c6\u8f6f\u4ef6\u5305\u653e\u5230\u4e00\u4e2a\u76ee\u5f55\u4e0b\n\u53ef\u4ee5\u57fa\u4e8e3.3\u7684\u65b9\u5f0f\uff0c\u4e5f\u53ef\u4ee5\u5077\u4e2a\u61d2\u76f4\u63a5\u7528\u955c\u50cf\u91cc\u73b0\u6210\u7684\uff0c\u6bd5\u7adf\u662f\u5b9e\u9a8c\u561b\uff0c\u4f46\u65e0\u8bba\u4f55\u79cd\u65b9\u5f0f\uff0c\u90fd\u4e00\u5b9a\u8981\u89e3\u51b3\u597d\u4f9d\u8d56\u5173\u7cfb\u624d\u80fd\u7528\u6765\u505ayum\u6e90\uff0c\u672c\u4f8b\u5c31\u7528\u73b0\u6210\u7684\u5427\n[root@egon ~]# mkdir \/var\/ftp\/centos7\n[root@egon ~]# mount \/dev\/sr0 \/var\/ftp\/centos7\n\n# \u6216\u8005\u62f7\u8d1d\n[root@egon ~]# mount \/dev\/sr0 \/opt\n[root@egon ~]# mkdir \/var\/ftp\/centos7\n[root@egon ~]# find \/opt\/Packages\/ -type f -name &quot;*.rpm&quot; |xargs -I {} cp -rp {} \/var\/ftp\/centos7\/\n\n==================\u5728\u5ba2\u6237\u7aef\u4e0a\u6267\u884c\u5982\u4e0b\u64cd\u4f5c==================\n# 1\u3001\u73af\u5883\u51c6\u5907\n[root@egon ~]# systemctl stop firewalld\n[root@egon ~]# systemctl disable firewalld\n[root@egon ~]# setenforce 0\n[root@egon ~]# sed -i &#039;s#^SELINUX=.*#SELINUX=disabled#g&#039; \/etc\/selinux\/config   \n[root@egon ~]# ping -c 2 192.168.12.42  # ping\u4e00\u4e0b\u670d\u52a1\u7aef\u7684ip\u5730\u5740\uff0c\u4fdd\u8bc1\u7f51\u7edc\u7545\u901a\n\n# 2\u3001\u5728\u5ba2\u6237\u7aef\u914d\u7f6e\u7f51\u7edcyum\u6e90\n[root@egon yum.repos.d]# cd \/etc\/yum.repos.d\/\n[root@egon yum.repos.d]# mkdir bak\n[root@egon yum.repos.d]# mv *.repo bak\/\n[root@egon yum.repos.d]# cat &gt;&gt; ftp.repo &lt;&lt; EOF\n> [ftp_repo]\n> name = This is Ftp Share Repo\n> baseurl = ftp:\/\/192.168.12.42\/centos7  \n> enabled = 1\n> gpgcheck = 0\n> EOF\n# \u6ce8\u610f\uff1a\u5ba2\u6237\u7aefbaseurl\u6307\u5411\u7684\u6587\u4ef6\u5939\u65e0\u8bba\u662f\u4ec0\u4e48\uff0c\u5728\u8be5\u6587\u4ef6\u5939\u7684\u5b50\u76ee\u5f55\u4e00\u7ea7\u5fc5\u987b\u6709\u4e00\u4e2arepodata\u6570\u636e\u5e93<\/code><\/pre>\n<h3>8\u3001yum\u7684\u5386\u53f2\u8bb0\u5f55<\/h3>\n<pre><code class=\"language-python\">yum history                       # \u67e5\u770b\u6267\u884c\u8fc7\u7684yum\u547d\u4ee4\u5386\u53f2\u8bb0\u5f55\nyum history info ID\u53f7             # \u67e5\u770b\u5177\u4f53\u67d0\u4e00\u6761yum\u547d\u4ee4\u7684\u8be6\u7ec6\u4fe1\u606f\nyum history undo ID\u53f7             # \u64a4\u9500\u6267\u884c\u8fc7\u7684\u5386\u53f2\u547d\u4ee4<\/code><\/pre>\n<h3>9\u3001\u62d3\u5c55\u4e86\u89e3\uff1a\u7b7e\u540d\u68c0\u67e5\u673a\u5236<\/h3>\n<pre><code class=\"language-python\">\uff1d\uff1dRPM\u5de5\u5177\u4f7f\u7528\u7b7e\u540d\u68c0\u67e5\u673a\u5236\uff1a\uff1d\uff1d\n[root@localhost ~]# rpm --import \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-7 # \u5bfc\u5165centos\u516c\u94a5\n[root@localhost ~]# rpm --import \/etc\/pki\/rpm-gpg\/*\n\n\u989d\u5916\u9009\u9879\uff1a\n--nomd5         # \u4e0d\u68c0\u9a8c\u8f6f\u4ef6\u5305\u7684\u7b7e\u540d\n\n\uff1d\uff1dYUM\u4f7f\u7528\u7b7e\u540d\u68c0\u67e5\u673a\u5236\uff1a\uff1d\uff1d\n\u65b9\u6cd5\u4e00\uff1a\n[root@localhost yum.repos.d]# rpm --import \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-7 \n[root@localhost yum.repos.d]# vim local.repo\n[local]\nname=local\nbaseurl=file:\/\/\/opt\nenabled=1\ngpgcheck=1  # \u5f00\u542f\u68c0\u67e5\u8f6f\u4ef6\u5305\u7684\u7b7e\u540d\n\n\u65b9\u6cd5\u4e8c\uff1a\n[root@localhost yum.repos.d]# vim local.repo\n[local]\nname=local\nbaseurl=file:\/\/\/opt\nenabled=1\ngpgcheck=1  # \u5f00\u542f\u68c0\u67e5\u8f6f\u4ef6\u5305\u7684\u7b7e\u540d\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-CentOS-7  # \u6307\u5b9a\u516c\u94a5\u6587\u4ef6\n\n\u989d\u5916\u9009\u9879\uff1a\n--nogpgcheck    \/\/\u4e0d\u68c0\u67e5\u8f6f\u4ef6\u5305\u7684\u7b7e\u540d<\/code><\/pre>\n<h2>\u56db \u6e90\u7801\u5305<\/h2>\n<h3>1\u3001\u5b98\u7f51\u4e0b\u8f7d\uff0c\u5982nginx<\/h3>\n<pre><code class=\"language-python\"># \u6d4f\u89c8\u5668\u4e0b\u8f7d\n# \u6216\u8005\u6267\u884c\u547d\u4ee4\nwget http:\/\/nginx.org\/download\/nginx-1.18.0.tar.gz\n\n\u6700\u65b0stable\u7248\u672c\uff1a\uff08\u7528\u8fd9\u4e2a\u7248\u672c\u7ec3\u4e60\uff0c\u5728centos7.9\u3001rockylinux9.3\u4e0a\u5b89\u88c5\uff09\nwget https:\/\/nginx.org\/download\/nginx-1.24.0.tar.gz<\/code><\/pre>\n<h3>2\u3001\u9884\u5148\u5b89\u88c5\u7f16\u8bd1\u5b89\u88c5\u4f9d\u8d56\u7684\u5e93<\/h3>\n<pre><code>yum -y install gcc gcc-c++ autoconf automake make      \nyum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel\n\n\u6216\u8005\nLANG=C yum -y groupinstall &quot;Development tools&quot;<\/code><\/pre>\n<h3>3\u3001\u89e3\u538b\u3001\u7f16\u8bd1\u3001\u7f16\u8bd1\u5b89\u88c5<\/h3>\n<pre><code class=\"language-python\">[root@localhost ~]# tar xvf nginx-1.18.0.tar.gz -C \/tmp\/\n[root@localhost ~]# cd \/tmp\/nginx-1.18.0\/ \n\n[root@localhost nginx-1.18.0]# useradd www\n[root@localhost nginx-1.18.0]# .\/configure --user=www --group=www --prefix=\/usr\/local\/nginx --with-http_stub_status_module --with-http_ssl_module --with-stream --with-http_gzip_static_module --with-http_sub_module\n\n#1\u3001--prefix \u6307\u5b9a\u5b89\u88c5\u7684\u76ee\u5f55,\/usr\/local\/nginx \u662f\u5b89\u88c5\u76ee\u5f55\n#2\u3001\u5e26ssl  stub_status\u6a21\u5757 \u6dfb\u52a0stream\u6a21\u5757 \u2013with-stream\uff0c\u8fd9\u6837\u5c31\u80fd\u4f20\u8f93tcp\u534f\u8bae\u4e86\n#3\u3001http_stub_status_module  \u72b6\u6001\u76d1\u63a7\n#4\u3001http_ssl_module    \u914d\u7f6ehttps\n#5\u3001stream  \u914d\u7f6etcp\u5f97\u8f6c\u53d1\n#6\u3001http_gzip_static_module \u538b\u7f29\n#7\u3001http_sub_module  \u66ff\u6362\u8bf7\u6c42\n\n[root@localhost nginx-1.18.0]# make &amp;&amp; make install\n\n# \u5c06\u7a0b\u5e8f\u8bbe\u5b9a\u4e00\u4e2a\u8f6f\u8fde\u63a5,\u4fbf\u4e8e\u540e\u7eed\u7684\u5347\u7ea7\n[root@egon soft]# ln -s \/soft\/nginx-1.16.0\/ \/soft\/nginx\n[root@egon ~]# \/soft\/nginx\/sbin\/nginx\n\u6ce8\u610f\uff1a\u73b0\u5728\u767e\u5206\u4e4b90,\u80fd\u7528\u4e0a\u7684\u8f6f\u4ef6,\u90fd\u63d0\u4f9b\u4e86rpm\u5305. ---&gt;\u4f7f\u7528\u6237\u53ef\u4ee5\u4f7f\u7528yum\u76f4\u63a5\u5b89\u88c5\u4f7f\u7528.<\/code><\/pre>\n<h3>\u603b\u7ed3\u7f16\u8bd1\u5b89\u88c5=\u300b\u4e09\u90e8\u66f2<\/h3>\n<pre><code class=\"language-python\"># .\/configure --prefix=\/usr\/local\/nginx-1.18.0\n   a. \u6307\u5b9a\u5b89\u88c5\u8def\u5f84\uff0c\u4f8b\u5982--prefix=DIR\n   b. \u542f\u7528\u6216\u7981\u7528\u67d0\u9879\u529f\u80fd, \u4f8b\u5982 --enable-ssl, --disable-filter --with-http_ssl_module\n   c. \u548c\u5176\u5b83\u8f6f\u4ef6\u5173\u8054\uff0c\u4f8b\u5982--with-pcre=\/root\/pcre-8.31\n   d. \u68c0\u67e5\u5b89\u88c5\u73af\u5883\uff0c\u4f8b\u5982\u662f\u5426\u6709\u7f16\u8bd1\u5668gcc\uff0c\u662f\u5426\u6ee1\u8db3\u8f6f\u4ef6\u7684\u4f9d\u8d56\u9700\u6c42\n   \u6700\u7ec8\u751f\u6210\uff1aMakefile\n# make          \/\/\u6309Makefile\u6587\u4ef6\u7f16\u8bd1\uff0c\u53ef\u4ee5\u4f7f\u7528-j 2\u6307\u5b9a\u4e24\u9897CPU\u7f16\u8bd1\n# make install  \/\/\u5b89\u88c5\n\nps:\u5982\u679c\u4e2d\u9014\u53d1\u751f\u9519\u8bef\uff0c\u591a\u534a\u662f\u56e0\u4e3a\u7f3a\u5c11\u5fc5\u8981\u7684\u5e93\u652f\u6301\uff0c\u53ef\u4ee5\u5148\u6e05\u7406\n# make clean    \/\/\u6e05\u7406\u6389\u4ee5\u524d\u7f16\u8bd1\u540e\u4ea7\u751f\u7684 *.o\u76ee\u6807\u6587\u4ef6\n\u7136\u540e\u5b89\u88c5\u597d\u4f9d\u8d56\u5e93\uff0c\u91cd\u65b0\u6267\u884c\u4e09\u90e8\u66f2<\/code><\/pre>\n<p>ps\uff1a\u6709\u4e00\u4e9b\u6e90\u7801\u5305\u662f\u5df2\u7ecf\u7f16\u8bd1\u597d\u7684\u7ed3\u679c\uff0c\u4e0b\u8f7d\u540e\u89e3\u538b\u5373\u53ef\u4f7f\u7528<\/p>\n<p>\u200b   <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6f\u4ef6\u5305\u7ba1\u7406 \u4e00 \u8f6f\u4ef6\u5305\u79cd\u7c7b \u7ea2\u5e3d\/Fedora\u7cfbLinux\u8f6f\u4ef6\u5305 \u5206\u7c7b \u5b89\u88c5 \u4f18\u7f3a\u70b9 rpm\u5305 \u9884\u5148\u7f16\u8bd1\u6253\u5305, [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":208,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[27],"tags":[21,19,35,22,20],"_links":{"self":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/207"}],"collection":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=207"}],"version-history":[{"count":10,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":8622,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/207\/revisions\/8622"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/media\/208"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}