{"id":6701,"date":"2022-06-24T09:48:39","date_gmt":"2022-06-24T01:48:39","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=6701"},"modified":"2022-06-24T12:57:18","modified_gmt":"2022-06-24T04:57:18","slug":"linux-under-various-installation-package","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-under-various-installation-package.html","title":{"rendered":"Linux\u4e0b\u8f6f\u4ef6\u5305\u7684\u591a\u79cd\u5b89\u88c5\u65b9\u5f0f"},"content":{"rendered":"
\n

\u672c\u6587\u7531lrxjmw.cn\u56e2\u961f\u6210\u5458\u9b4f\u4e3d\u733f<\/span>\u6574\u7406\u53d1\u5e03\uff0c\u539f\u6587\u6765\u81ea\uff1a\u7ec6\u8bf4Linux<\/a>\u3002<\/p>\n<\/div>\n

\u6e90\u7801\u5305\u5b89\u88c5<\/strong><\/div>\n

\u5728Linux\u4e0b\u7684\u5f88\u591a\u8f6f\u4ef6\u90fd\u662f\u901a\u8fc7\u6e90\u7801\u5305\u65b9\u5f0f\u53d1\u5e03\u7684\uff0c\u867d\u7136\u76f8\u5bf9\u4e8e\u4e8c\u8fdb\u5236\u8f6f\u4ef6\u5305\uff0c\u914d\u7f6e\u548c\u7f16\u8bd1\u8d77\u6765\u7e41\u7410\u70b9\uff0c\u4f46\u662f\u5b83\u7684\u53ef\u79fb\u690d\u6027\u5374\u597d\u5f97\u591a\uff0c\u9488\u5bf9\u4e0d\u540c\u7684\u4f53\u7cfb\u7ed3\u6784\uff0c\u8f6f\u4ef6\u5f00\u53d1\u8005\u5f80\u5f80\u4ec5\u9700\u53d1\u5e03\u540c\u4e00\u4efd\u6e90\u7801\u5305\uff0c\u4e0d\u540c\u7684\u6700\u7ec8\u7528\u6237\u7ecf\u8fc7\u7f16\u8bd1\u5c31\u53ef\u4ee5\u6b63\u786e\u8fd0\u884c\u3002
\n\u5b89\u88c5\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n

$ tar zxvf XXXX.tar.gz (or tar jxvf XXXX.tar.bz2)\r\n$ cd XXXX\r\n$ .\/configure\r\n$ make\r\n# make install            ##\u5b89\u88c5\r\n$ make clean              ##\u5b89\u88c5\u5b8c\u6210\u540e\u7528\u6765\u6e05\u7406\u4e34\u65f6\u6587\u4ef6\r\n$ake uninstall            ##\u7528\u6765\u5378\u8f7d\u8f6f\u4ef6\r\n<\/pre>\n

1\u3001\u89e3\u538b:<\/strong>
\n\u6700\u5e38\u89c1\u6e90\u7801\u5305\u7684\u5c31\u4e24\u79cd(XXXX.tar.gz or XXXX.tar.bz2),\u5176\u5b9e\u8fd9\u4e9b\u6e90\u7801\u5305\u90fd\u662f\u75312\u4e2a\u5de5\u5177\u538b\u7f29\u800c\u6210\u7684\uff0ctar.gz\u7ed3\u5c3e\u7684\u6587\u4ef6\u7528\u5230\u7684\u5de5\u5177\u662ftar\u548cgunzip,\u800ctar.bz2\u7ed3\u5c3e\u7684\u6587\u4ef6\u6240\u4f7f\u7528\u7684\u5de5\u5177\u662ftar\u548cbzip2,\u4e4b\u6240\u4ee5\u8fd9\u6837\u505a\u662f\u56e0\u4e3a\uff0ctar\u4ec5\u4ec5\u80fd\u591f\u6253\u5305\u591a\u4e2a\u6587\u4ef6\u4f46\u662f\u6ca1\u6709\u538b\u7f29\u7684\u529f\u80fd\uff0c\u800cgz\u548cbz2\u5374\u521a\u597d\u76f8\u53cd\uff0c\u4ec5\u80fd\u591f\u538b\u7f29\u5355\u4e2a\u6587\u4ef6\uff0c\u8fd9\u6837\u6211\u4eec\u5e38\u89c1\u7684\u6e90\u7801\u5305\u5b9e\u9645\u4e0a\u662f\u901a\u8fc7tar\u5148\u5c06\u4e0d\u540c\u7684\u6e90\u6587\u4ef6\u6253\u5305\uff0c\u7136\u540e\u518d\u901a\u8fc7gunzip\u6216\u8005bzip2\u538b\u7f29\u540e\u53d1\u5e03\u7684\uff0c\u5f53\u7136\u8fd9\u4e24\u4e2a\u6b65\u9aa4\u53ef\u4ee5\u901a\u8fc7\u4e00\u6761\u547d\u4ee4\u5b9e\u73b0:<\/p>\n

$ tar zcvf XXXX.tar.gz XXXX(or tar jcvf XXXX.tar.bz2 XXXX)\r\n\u89e3\u538b\u7684\u76f8\u5173\u547d\u4ee4\u5982\u4e0b:\r\n$ tar zxvf XXXX.tar.gz\r\n$ tar jxvf XXXX.tar.bz2\r\n<\/pre>\n

2\u3001.\/configure:<\/strong>
\n\u89e3\u538b\u5b8c\u6210\u5c31\u6b63\u5f0f\u5f00\u59cb\u5b89\u88c5\u4e86(\u8865\u5145\u4e00\u70b9\uff0c\u5f00\u59cbconfigure\u4e4b\u524d\uff0c\u5982\u6709\u5fc5\u8981\uff0c\u8bf7\u4f7f\u7528patch\u5de5\u5177\u4e3a\u6e90\u7801\u6253\u4e0a\u76f8\u5e94\u7684\u8865\u4e01),\u9996\u5148\u8df3\u8f6c\u5230\u6e90\u7801\u7684\u89e3\u538b\u76ee\u5f55\uff0c\u4f17\u6240\u5468\u77e5\uff0c\u5f00\u59cbconfigure\u524d\u8fd8\u662f\u5e94\u8be5\u4ed4\u7ec6\u9605\u8bfb\u6e90\u7801\u76ee\u5f55\u4e0b\u7684README\u6216\u8005INSTALL\u6587\u4ef6,\u597d\u591a\u5b89\u88c5\u4e2d\u7684\u6ce8\u610f\u4e8b\u9879\u5728\u8fd9\u91cc\u90fd\u6709\u6240\u7f57\u5217,configure\u5b9e\u9645\u4e0a\u662f\u4e00\u4e2a\u811a\u672c\u6587\u4ef6\uff0c\u5728\u5f53\u524d\u76ee\u5f55\u4e2d\u952e\u5165\".\/configure\",shell\u5c31\u4f1a\u8fd0\u884c\u5f53\u524d\u76ee\u5f55\u4e0b\u7684configure\u811a\u672c\uff0c\u6709\u4e00\u70b9\u5fc5\u987b\u8bf4\u660e\uff0c\u5728\u6574\u4e2aconfigure\u8fc7\u7a0b\uff0c\u5176\u5b9e\u7f16\u8bd1\u5c1a\u672a\u8fdb\u884c\uff0cconfigure\u4ec5\u4ec5\u662f\u505a\u7f16\u8bd1\u76f8\u5173\u7684\u51c6\u5907\u5de5\u4f5c\uff0c\u5b83\u4e3b\u8981\u5bf9\u60a8\u5f53\u524d\u7684\u5de5\u4f5c\u5e73\u53f0\u505a\u4e00\u4e9b\u4f9d\u8d56\u6027\u68c0\u67e5\uff0c\u6bd4\u5982\u7f16\u8bd1\u5668\u662f\u5426\u5b89\u88c5\uff0c\u8fde\u63a5\u5668\u662f\u5426\u5b58\u5728\uff0c\u5982\u679c\u5728\u68c0\u6d4b\u7684\u8fc7\u7a0b\u6ca1\u6709\u4efb\u4f55\u9519\u8bef\uff0c\u4f60\u5f88\u5e78\u8fd0\uff0cconfigure\u811a\u672c\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u751f\u6210\u4e0b\u4e00\u6b65\u7f16\u8bd1\u94fe\u63a5\u6240\u8981\u7528\u5230\u7684\u53e6\u4e00\u4e2a\u6587\u4ef6Makefile\uff0c\u5f53\u7136configure\u652f\u6301\u53ca\u5176\u4e30\u5bcc\u7684\u547d\u4ee4\u884c\u53c2\u6570\uff0c\u53ef\u4ee5\u952e\u5165\".\/configre --help\"\u83b7\u53d6\u5177\u4f53\u7684\u4fe1\u606f\uff0c\u6700\u5e38\u7528\u7684\u6050\u6015\u5c31\u662f:<\/p>\n

$ .\/configure --prefix=\/opt\/XXX\r\n\u5b83\u7528\u6765\u8bbe\u7f6e\u8f6f\u4ef6\u7684\u5b89\u88c5\u76ee\u5f55. \r\n<\/pre>\n

3\u3001make:<\/strong>
\n\u5982\u679cconfigure\u8fc7\u7a0b\u6b63\u786e\u5b8c\u6210\uff0c\u90a3\u4e48\u5728\u6e90\u7801\u76ee\u5f55\uff0c\u4f1a\u751f\u6210\u76f8\u5e94\u7684Makefile\u6587\u4ef6\uff0cMakefile\u6587\u4ef6\u7b80\u5355\u6765\u8bf4\u5305\u62ec\u7684\u662f\u4e00\u7ec4\u6587\u4ef6\u4f9d\u8d56\u5173\u7cfb\u4ee5\u53ca\u7f16\u8bd1\u94fe\u63a5\u7684\u76f8\u5173\u6b65\u9aa4\uff0c\u4e8b\u5b9e\u4e0a\u771f\u6b63\u7684\u7f16\u8bd1\u94fe\u63a5\u5de5\u4f5c\u4e5f\u4e0d\u662fmake\u6240\u505a\u7684\uff0cmake\u53ea\u662f\u4e00\u4e2a\u901a\u7528\u7684\u5de5\u5177\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\uff0cmake\u4f1a\u6839\u636eMakefile\u4e2d\u7684\u89c4\u5219\u8c03\u7528\u5408\u9002\u7684\u7f16\u8bd1\u5668\u7f16\u8bd1\u6240\u6709\u4e0e\u5f53\u524d\u8f6f\u4ef6\u76f8\u4f9d\u8d56\u7684\u6e90\u7801\uff0c\u751f\u6210\u6240\u6709\u76f8\u5173\u7684\u76ee\u6807\u6587\u4ef6\uff0c\u6700\u540e\u518d\u4f7f\u7528\u94fe\u63a5\u5668\u751f\u6210\u6700\u7ec8\u7684\u53ef\u6267\u884c\u7a0b\u5e8f:<\/p>\n

$ make<\/pre>\n

4\u3001make install:<\/strong>
\n\u5f53\u4e0a\u9762\u4e24\u4e2a\u6b65\u9aa4\u6b63\u786e\u5b8c\u6210\uff0c\u4ee3\u8868\u7740\u7f16\u8bd1\u94fe\u63a5\u8fc7\u7a0b\u5df2\u7ecf\u5b8c\u5168\u7ed3\u675f\uff0c\u6700\u540e\u8981\u505a\u7684\u5c31\u662f\u5c06\u53ef\u6267\u884c\u7a0b\u5e8f\u5b89\u88c5\u5230\u6b63\u786e\u7684\u4f4d\u7f6e\uff0c\u5728\u8fd9\u4e2a\u6b65\u9aa4\uff0c\u666e\u901a\u7528\u6237\u53ef\u80fd\u6ca1\u6709\u76f8\u5173\u76ee\u5f55\u7684\u64cd\u4f5c\u6743\u9650\uff0c\u4e34\u65f6\u5207\u6362\u5230root\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\uff0c\"install\"\u53ea\u662fMakefile\u6587\u4ef6\u4e2d\u7684\u4e00\u4e2a\u6807\u53f7,\"make install\"\u4ee3\u8868\u7740make\u5de5\u5177\u6267\u884cMakefile\u6587\u4ef6\u4e2d\"install\"\u6807\u53f7\u4e0b\u7684\u6240\u6709\u76f8\u5173\u64cd\u4f5c\uff0c\u5982\u679c\u5728configure\u9636\u6bb5\u6ca1\u6709\u4f7f\u7528\"--prefix=\/opt\/XXX\"\u6307\u5b9a\u5e94\u7528\u7a0b\u5e8f\u7684\u5b89\u88c5\u76ee\u5f55\uff0c\u90a3\u4e48\u5e94\u7528\u7a0b\u5e8f\u4e00\u822c\u4f1a\u88ab\u9ed8\u8ba4\u5b89\u88c5\u5230\/usr\/local\/bin\uff0c\u5982\u679c\/usr\/local\/bin\u5df2\u7ecf\u5b58\u5728\u4e8e\u60a8\u7684PATH\u4e2d\uff0c\u90a3\u4e48\u5b89\u88c5\u5df2\u7ecf\u57fa\u672c\u7ed3\u675f:<\/p>\n

$make install\r\n<\/pre>\n

\u6267\u884c\u5b8c\u4e0a\u8ff0\u64cd\u4f5c\u5c31\u53ef\u4ee5\u7b49\u5f85\u5b89\u88c5\u5b8c\u6210\u4e86\u3002<\/p>\n

$make clean\r\n$make uninstall\r\n<\/pre>\n

\u8fd9\u4e24\u4e2a\u6b65\u9aa4\u53ea\u662f\u5b89\u88c5\u7684\u540e\u7eed\u64cd\u4f5c\uff0c\u6709\u4e00\u70b9\u5fc5\u987b\u6ce8\u610f\uff0c\"clean\"\u548c\"uninstall\"\u4e5f\u662fMakefile\u6587\u4ef6\u4e2d\u76f8\u5e94\u7684\u4e24\u4e2a\u6807\u53f7\uff0c\u6267\u884c\u8fd9\u4e24\u4e2a\u6b65\u9aa4\u7684\u65f6\u5019Makefile\u6587\u4ef6\u5fc5\u8981\u4fdd\u7559\uff0c\"make clean\"\u7528\u6765\u6e05\u9664\u7f16\u8bd1\u8fde\u63a5\u8fc7\u7a0b\u4e2d\u7684\u4e00\u4e9b\u4e34\u65f6\u6587\u4ef6\uff0c\"make uninstall\"\u662f\u5378\u8f7d\u76f8\u5173\u5e94\u7528\u7a0b\u5e8f\uff0c\u4e0emake install\u7c7b\u4f3c\uff0cmake uninstall\u4e5f\u9700\u8981\u5207\u6362\u5230root\u6267\u884c\uff0c\u4e0d\u8fc7\"uninstall\"\u6807\u53f7\u5728\u597d\u591aMakefile\u4e2d\u90fd\u88ab\u7701\u7565\u6389\u4e86\u3002<\/p>\n

RPM\u5305\u5b89\u88c5<\/strong><\/div>\n

1\u3001\u5982\u4f55\u5b89\u88c5rpm\u8f6f\u4ef6\u5305<\/strong>
\nrmp\u8f6f\u4ef6\u5305\u7684\u5b89\u88c5\u53ef\u4ee5\u4f7f\u7528\u7a0b\u5e8frpm\u6765\u5b8c\u6210\u3002\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4<\/p>\n

rpm -i your-package.rpm<\/pre>\n

\u5176\u4e2dyour-package.rpm\u662f\u4f60\u8981\u5b89\u88c5\u7684rpm\u5305\u7684\u6587\u4ef6\u540d\uff0c\u4e00\u822c\u7f6e\u4e8e\u5f53\u524d\u76ee\u5f55\u4e0b\u3002
\n\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u51fa\u73b0\u4e0b\u9762\u7684\u8b66\u544a\u6216\u8005\u63d0\u793a\uff1a<\/p>\n

... conflict with ... \u53ef\u80fd\u662f\u8981\u5b89\u88c5\u7684\u5305\u91cc\u6709\u4e00\u4e9b\u6587\u4ef6\u53ef\u80fd\u4f1a\u8986\u76d6\u73b0\u6709\r\n\u7684\u6587\u4ef6\uff0c\u7f3a\u7701\u65f6\u8fd9\u6837\u7684\u60c5\u51b5\u4e0b\u662f\u65e0\u6cd5\u6b63\u786e\u5b89\u88c5\u7684\u53ef\u4ee5\u7528\r\nrpm --force -i \u5f3a\u5236\u5b89\u88c5\u5373\u53ef\r\n... is needed by ...\r\n... is not installed ... \u6b64\u5305\u9700\u8981\u7684\u4e00\u4e9b\u8f6f\u4ef6\u4f60\u6ca1\u6709\u5b89\u88c5\u53ef\u4ee5\u7528\r\nrpm --nodeps -i \u6765\u5ffd\u7565\u6b64\u4fe1\u606f\r\n\u4e5f\u5c31\u662f\u8bf4\uff0crpm -i --force --nodeps \u53ef\u4ee5\u5ffd\u7565\u6240\u6709\u4f9d\u8d56\u5173\u7cfb\u548c\u6587\u4ef6\u95ee\u9898\uff0c\u4ec0\u4e48\u5305\r\n\u90fd\u80fd\u5b89\u88c5\u4e0a\uff0c\u4f46\u8fd9\u79cd\u5f3a\u5236\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u4e0d\u80fd\u4fdd\u8bc1\u5b8c\u5168\u53d1\u6325\u529f\u80fd\r\n<\/pre>\n

2\u3001\u5982\u4f55\u5b89\u88c5.src.rpm\u8f6f\u4ef6\u5305<\/strong>
\n\u6709\u4e9b\u8f6f\u4ef6\u5305\u662f\u4ee5.src.rpm\u7ed3\u5c3e\u7684\uff0c\u8fd9\u7c7b\u8f6f\u4ef6\u5305\u662f\u5305\u542b\u4e86\u6e90\u4ee3\u7801\u7684rpm\u5305\uff0c\u5728\u5b89\u88c5\u65f6
\n\u9700\u8981\u8fdb\u884c\u7f16\u8bd1\u3002\u8fd9\u7c7b\u8f6f\u4ef6\u5305\u6709\u4e24\u79cd\u5b89\u88c5\u65b9\u6cd5\uff0c
\n\u65b9\u6cd5\u4e00\uff1a<\/p>\n

1.\u6267\u884crpm -i your-package.src.rpm\r\n2. cd \/usr\/src\/redhat\/SPECS\r\n3. rpmbuild -bp your-package.specs \u4e00\u4e2a\u548c\u4f60\u7684\u8f6f\u4ef6\u5305\u540c\u540d\u7684specs\u6587\u4ef6\r\n4. cd \/usr\/src\/redhat\/BUILD\/your-package\/ \u4e00\u4e2a\u548c\u4f60\u7684\u8f6f\u4ef6\u5305\u540c\u540d\u7684\u76ee\u5f55\r\n5. .\/configure \u8fd9\u4e00\u6b65\u548c\u7f16\u8bd1\u666e\u901a\u7684\u6e90\u7801\u8f6f\u4ef6\u4e00\u6837\uff0c\u53ef\u4ee5\u52a0\u4e0a\u53c2\u6570\r\n6. make\r\n7. make install\r\n<\/pre>\n

\u65b9\u6cd5\u4e8c:<\/p>\n

1.\u6267\u884crpm -i you-package.src.rpm\r\n2. cd \/usr\/src\/redhat\/SPECS                 \u524d\u4e24\u6b65\u548c\u65b9\u6cd5\u4e00\u76f8\u540c\r\n3. rpmbuild -bb your-package.specs          \u4e00\u4e2a\u548c\u4f60\u7684\u8f6f\u4ef6\u5305\u540c\u540d\u7684specs\u6587\u4ef6\r\n<\/pre>\n

\u8fd9\u65f6\uff0c\u5728\/usr\/src\/redhat\/RPM\/i386\/ \uff08\u6839\u636e\u5177\u4f53\u5305\u7684\u4e0d\u540c\uff0c\u4e5f\u53ef\u80fd\u662fi686,noarch\u7b49\u7b49)\u76ee\u5f55\u4e0b\uff0c\u6709\u4e00\u4e2a\u65b0\u7684rpm\u5305\uff0c\u8fd9\u4e2a\u662f\u7f16\u8bd1\u597d\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6,\u6267\u884crpm -i new-package.rpm\u5373\u53ef\u5b89\u88c5\u5b8c\u6210\u3002
\n3\u3001\u5982\u4f55\u5378\u8f7drpm\u8f6f\u4ef6\u5305<\/strong>
\n\u4f7f\u7528\u547d\u4ee4 rpm -e \u5305\u540d\uff0c\u5305\u540d\u53ef\u4ee5\u5305\u542b\u7248\u672c\u53f7\u7b49\u4fe1\u606f\uff0c\u4f46\u662f\u4e0d\u53ef\u4ee5\u6709\u540e\u7f00.rpm
\n\u6bd4\u5982\u5378\u8f7d\u8f6f\u4ef6\u5305proftpd-1.2.8-1\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u5217\u683c\u5f0f\uff1a<\/p>\n

rpm -e proftpd-1.2.8-1\r\nrpm -e proftpd-1.2.8\r\nrpm -e proftpd-\r\nrpm -e proftpd\r\n<\/pre>\n

\u4e0d\u53ef\u4ee5\u662f\u4e0b\u5217\u683c\u5f0f\uff1a<\/p>\n

rpm -e proftpd-1.2.8-1.i386.rpm\r\nrpm -e proftpd-1.2.8-1.i386\r\nrpm -e proftpd-1.2\r\nrpm -e proftpd-1\r\n<\/pre>\n

\u6709\u65f6\u4f1a\u51fa\u73b0\u4e00\u4e9b\u9519\u8bef\u6216\u8005\u8b66\u544a\uff1a<\/p>\n

... is needed by ... \u8fd9\u8bf4\u660e\u8fd9\u4e2a\u8f6f\u4ef6\u88ab\u5176\u4ed6\u8f6f\u4ef6\u9700\u8981\uff0c\u4e0d\u80fd\u968f\u4fbf\u5378\u8f7d\r\n<\/pre>\n

\u53ef\u4ee5\u7528rpm -e --nodeps\u5f3a\u5236\u5378\u8f7d
\n4\u3001\u5982\u4f55\u4e0d\u5b89\u88c5\u4f46\u662f\u83b7\u53d6rpm\u5305\u4e2d\u7684\u6587\u4ef6<\/strong>
\n\u4f7f\u7528\u5de5\u5177rpm2cpio\u548ccpio<\/p>\n

rpm2cpio xxx.rpm | cpio -vi\r\nrpm2cpio xxx.rpm | cpio -idmv\r\nrpm2cpio xxx.rpm | cpio --extract --make-directories<\/pre>\n

\u53c2\u6570i\u548cextract\u76f8\u540c\uff0c\u8868\u793a\u63d0\u53d6\u6587\u4ef6\u3002v\u8868\u793a\u6307\u793a\u6267\u884c\u8fdb\u7a0b
\nd\u548cmake-directory\u76f8\u540c\uff0c\u8868\u793a\u6839\u636e\u5305\u4e2d\u6587\u4ef6\u539f\u6765\u7684\u8def\u5f84\u5efa\u7acb\u76ee\u5f55
\nm\u8868\u793a\u4fdd\u6301\u6587\u4ef6\u7684\u66f4\u65b0\u65f6\u95f4\u3002
\n5\u3001\u5982\u4f55\u67e5\u770b\u4e0erpm\u5305\u76f8\u5173\u7684\u6587\u4ef6\u548c\u5176\u4ed6\u4fe1\u606f<\/strong>
\n\u4e0b\u9762\u6240\u6709\u7684\u4f8b\u5b50\u90fd\u5047\u8bbe\u4f7f\u7528\u8f6f\u4ef6\u5305mysql-3.23.54a-11
\n1.\u6211\u7684\u7cfb\u7edf\u4e2d\u5b89\u88c5\u4e86\u90a3\u4e9brpm\u8f6f\u4ef6\u5305<\/p>\n

rpm -qa  \u5217\u51fa\u6240\u6709\u5b89\u88c5\u8fc7\u7684\u5305<\/pre>\n

\u5982\u679c\u8981\u67e5\u627e\u6240\u6709\u5b89\u88c5\u8fc7\u7684\u5305\u542b\u67d0\u4e2a\u5b57\u7b26\u4e32sql\u7684\u8f6f\u4ef6\u5305<\/p>\n

rpm -qa |grep sql<\/pre>\n

2.\u5982\u4f55\u83b7\u5f97\u67d0\u4e2a\u8f6f\u4ef6\u5305\u7684\u6587\u4ef6\u5168\u540d<\/p>\n

rpm -q mysql \u53ef\u4ee5\u83b7\u5f97\u7cfb\u7edf\u4e2d\u5b89\u88c5\u7684mysql\u8f6f\u4ef6\u5305\u5168\u540d\uff0c\u4ece\u4e2d\u53ef\u4ee5\u83b7\u5f97\u5f53\u524d\u8f6f\u4ef6\u5305\u7684\u7248\u672c\u7b49\u4fe1\u606f\u3002<\/pre>\n

\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\u53ef\u4ee5\u5f97\u5230\u4fe1\u606fmysql-3.23.54a-11
\n3.\u4e00\u4e2arpm\u5305\u4e2d\u7684\u6587\u4ef6\u5b89\u88c5\u5230\u90a3\u91cc\u53bb\u4e86\uff1f<\/p>\n

rpm -ql \u5305\u540d            \u6ce8\u610f\u8fd9\u91cc\u7684\u662f\u4e0d\u5305\u62ec.rpm\u540e\u7f00\u7684\u8f6f\u4ef6\u5305\u7684\u540d\u79f0<\/pre>\n

\u4e5f\u5c31\u662f\u8bf4\u53ea\u80fd\u7528mysql\u6216\u8005mysql-3.23.54a-11\u800c\u4e0d\u662fmysql-3.23.54a-11.rpm,\u5982\u679c\u53ea\u662f\u60f3\u77e5\u9053\u53ef\u6267\u884c\u7a0b\u5e8f\u653e\u5230\u90a3\u91cc\u53bb\u4e86\uff0c\u4e5f\u53ef\u4ee5\u7528which\uff0c\u6bd4\u5982<\/p>\n

which mysql<\/pre>\n

4.\u4e00\u4e2arpm\u5305\u4e2d\u5305\u542b\u90a3\u4e9b\u6587\u4ef6<\/p>\n

\u4e00\u4e2a\u6ca1\u6709\u5b89\u88c5\u8fc7\u7684\u8f6f\u4ef6\u5305\uff0c\u4f7f\u7528:rpm -qlp ****.rpm\r\n\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\u8fc7\u7684\u8f6f\u4ef6\u5305\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528:rpm -ql ****.rpm<\/pre>\n

5.\u5982\u4f55\u83b7\u53d6\u5173\u4e8e\u4e00\u4e2a\u8f6f\u4ef6\u5305\u7684\u7248\u672c\uff0c\u7528\u9014\u7b49\u76f8\u5173\u4fe1\u606f\uff1f<\/p>\n

\u4e00\u4e2a\u6ca1\u6709\u5b89\u88c5\u8fc7\u7684\u8f6f\u4ef6\u5305\uff0c\u4f7f\u7528rpm -qip ****.rpm\r\n\u4e00\u4e2a\u5df2\u7ecf\u5b89\u88c5\u8fc7\u7684\u8f6f\u4ef6\u5305\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528rpm -qi ****.rpm<\/pre>\n

6.\u67d0\u4e2a\u7a0b\u5e8f\u662f\u54ea\u4e2a\u8f6f\u4ef6\u5305\u5b89\u88c5\u7684\uff0c\u6216\u8005\u54ea\u4e2a\u8f6f\u4ef6\u5305\u5305\u542b\u8fd9\u4e2a\u7a0b\u5e8f<\/p>\n

rpm -qf `which \u7a0b\u5e8f\u540d` \u8fd4\u56de\u8f6f\u4ef6\u5305\u7684\u5168\u540d\r\nrpm -qif `which \u7a0b\u5e8f\u540d` \u8fd4\u56de\u8f6f\u4ef6\u5305\u7684\u6709\u5173\u4fe1\u606f\r\nrpm -qlf `which \u7a0b\u5e8f\u540d` \u8fd4\u56de\u8f6f\u4ef6\u5305\u7684\u6587\u4ef6\u5217\u8868<\/pre>\n

\u6ce8\u610f\uff0c\u8fd9\u91cc\u4e0d\u662f\u5f15\u53f7\uff0c\u800c\u662f`\uff0c\u5c31\u662f\u952e\u76d8\u5de6\u4e0a\u89d2\u7684\u90a3\u4e2a\u952e,\u4e5f\u53ef\u4ee5\u4f7f\u7528rpm -qilf<\/strong>\uff0c\u540c\u65f6\u8f93\u51fa\u8f6f\u4ef6\u5305\u4fe1\u606f\u548c\u6587\u4ef6\u5217\u8868
\n7.\u67d0\u4e2a\u6587\u4ef6\u662f\u54ea\u4e2a\u8f6f\u4ef6\u5305\u5b89\u88c5\u7684\uff0c\u6216\u8005\u54ea\u4e2a\u8f6f\u4ef6\u5305\u5305\u542b\u8fd9\u4e2a\u6587\u4ef6
\n\u6ce8\u610f\uff0c\u524d\u4e00\u4e2a\u95ee\u9898\u4e2d\u7684\u65b9\u6cd5\uff0c\u53ea\u9002\u7528\u4e0e\u53ef\u6267\u884c\u7684\u7a0b\u5e8f\uff0c\u800c\u4e0b\u9762\u7684\u65b9\u6cd5\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u7528\u4e8e\u53ef\u6267\u884c\u7a0b\u5e8f\uff0c\u4e5f\u53ef\u4ee5\u7528\u4e8e\u666e\u901a\u7684\u4efb\u4f55\u6587\u4ef6,\u524d\u63d0\u662f\u77e5\u9053\u8fd9\u4e2a\u6587\u4ef6\u540d,\u9996\u5148\u83b7\u5f97\u8fd9\u4e2a\u7a0b\u5e8f\u7684\u5b8c\u6574\u8def\u5f84\uff0c\u53ef\u4ee5\u7528whereis\u6216\u8005which\uff0c\u7136\u540e\u4f7f\u7528rpm -qf\u4f8b\u5982\uff1a<\/p>\n

# whereis ftptop\r\nftptop: \/usr\/bin\/ftptop \/usr\/share\/man\/man1\/ftptop.1.gz\r\n# rpm -qf \/usr\/bin\/ftptop\r\nproftpd-1.2.8-1\r\n# rpm -qf \/usr\/share\/doc\/proftpd-1.2.8\/rfc\/rfc0959.txt\r\nproftpd-1.2.8-1\r\n<\/pre>\n

\u83b7\u5f97\u8f6f\u4ef6\u5305\u76f8\u5173\u7684\u4fe1\u606f\u7528rpm -q\uff0cq\u8868\u793a\u67e5\u8be2query\uff0c\u540e\u9762\u53ef\u4ee5\u8ddf\u5176\u4ed6\u9009\u9879\uff0c\u6bd4\u5982<\/p>\n

i \u8868\u793ainfo\uff0c\u83b7\u5f97\u8f6f\u4ef6\u5305\u7684\u4fe1\u606f\uff1b\r\nl \u8868\u793alist\uff0c\u83b7\u5f97\u6587\u4ef6\u5217\u8868\uff1b\r\na \u8868\u793aall\uff0c\u5728\u6240\u6709\u5305\u4e2d\u6267\u884c\u67e5\u8be2\uff1b\r\nf \u8868\u793afile\uff0c\u6839\u636e\u6587\u4ef6\u8fdb\u884c\u76f8\u5173\u7684\u67e5\u8be2\uff1b\r\np \u8868\u793apackage\uff0c\u6839\u636e\u8f6f\u4ef6\u5305\u8fdb\u884c\u67e5\u8be2\r\n\u9700\u8981\u7684\u67e5\u8be2\u6761\u4ef6\u53ef\u4ee5\u4f7f\u7528grep\u4ea7\u751f\uff0c\u6216\u8005\u4ece\"` `\"\u4e2d\u7684\u547d\u4ee4\u884c\u4ea7\u751f<\/pre>\n
yum\u5b89\u88c5<\/strong><\/div>\n

\u81ea\u52a8\u641c\u7d22\u6700\u5feb\u955c\u50cf\u63d2\u4ef6\uff1ayum install yum-fastestmirror
\n\u5b89\u88c5yum\u56fe\u5f62\u7a97\u53e3\u63d2\u4ef6\uff1ayum install yumex
\n1\u3001\u5b89\u88c5<\/strong><\/p>\n

yum install \u5168\u90e8\u5b89\u88c5\r\nyum install package1 \u5b89\u88c5\u6307\u5b9a\u7684\u5b89\u88c5\u5305package1\r\nyum groupinsall group1 \u5b89\u88c5\u7a0b\u5e8f\u7ec4group1\r\n<\/pre>\n

2\u3001\u66f4\u65b0\u548c\u5347\u7ea7<\/strong><\/p>\n

yum update \u5168\u90e8\u66f4\u65b0\r\nyum update package1 \u66f4\u65b0\u6307\u5b9a\u7a0b\u5e8f\u5305package1\r\nyum check-update \u68c0\u67e5\u53ef\u66f4\u65b0\u7684\u7a0b\u5e8f\r\nyum upgrade package1 \u5347\u7ea7\u6307\u5b9a\u7a0b\u5e8f\u5305package1\r\nyum groupupdate group1 \u5347\u7ea7\u7a0b\u5e8f\u7ec4group1\r\n<\/pre>\n

3\u3001\u67e5\u627e\u548c\u663e\u793a<\/strong><\/p>\n

yum info package1 \u663e\u793a\u5b89\u88c5\u5305\u4fe1\u606fpackage1\r\nyum list \u663e\u793a\u6240\u6709\u5df2\u7ecf\u5b89\u88c5\u548c\u53ef\u4ee5\u5b89\u88c5\u7684\u7a0b\u5e8f\u5305\r\nyum list package1 \u663e\u793a\u6307\u5b9a\u7a0b\u5e8f\u5305\u5b89\u88c5\u60c5\u51b5package1\r\nyum groupinfo group1 \u663e\u793a\u7a0b\u5e8f\u7ec4group1\u4fe1\u606fyum search string \u6839\u636e\u5173\u952e\u5b57string\u67e5\u627e\u5b89\u88c5\u5305\r\n<\/pre>\n

4\u3001\u5220\u9664\u7a0b\u5e8f<\/strong><\/p>\n

yum remove | erase package1 \u5220\u9664\u7a0b\u5e8f\u5305package1\r\nyum groupremove group1 \u5220\u9664\u7a0b\u5e8f\u7ec4group1\r\nyum deplist package1 \u67e5\u770b\u7a0b\u5e8fpackage1\u4f9d\u8d56\u60c5\u51b5\r\n<\/pre>\n

5\u3001\u6e05\u9664\u7f13\u5b58<\/strong><\/p>\n

yum clean packages \u6e05\u9664\u7f13\u5b58\u76ee\u5f55\u4e0b\u7684\u8f6f\u4ef6\u5305\r\nyum clean headers \u6e05\u9664\u7f13\u5b58\u76ee\u5f55\u4e0b\u7684 headers\r\nyum clean oldheaders \u6e05\u9664\u7f13\u5b58\u76ee\u5f55\u4e0b\u65e7\u7684 headers\r\nyum clean, yum clean all (= yum clean packages; yum clean oldheaders) \u6e05\u9664\u7f13\u5b58\u76ee\u5f55\u4e0b\u7684\u8f6f\u4ef6\u5305\u53ca\u65e7\u7684headers\r\n<\/pre>\n

6\u3001TIPS<\/strong>
\n1.\u8ba9yum\u547d\u4ee4\u4e0b\u8f7d\u8f6f\u4ef6\u5305\uff0c\u4f46\u662f\u4e0d\u5b89\u88c5
\nyum\u6709\u4e00\u4e2aplugin\u53eb\u505ayum-downloadonly\uff0c\u5b83\u5c31\u53ef\u4ee5\u4e3a\u7528\u6237\u5b9e\u73b0\u53ea\u4e0b\u8f7d\u8f6f\u4ef6\u5305\u7684\u529f\u80fd\u3002
\n\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u8fd9\u4e2a\u63d2\u4ef6\uff1a<\/p>\n

yum install yum-downloadonly<\/pre>\n

\u5b8c\u6210\u5b89\u88c5\u540e\uff0cyum\u5c31\u591a\u4e86\u4e24\u4e2a\u547d\u4ee4\u53c2\u6570\uff0c\u5206\u522b\u662f\uff1a<\/p>\n

--downloadonly\r\n--downloaddir=\/path\/to\/dir<\/pre>\n

\u8fd9\u4e24\u4e2a\u547d\u4ee4\u53c2\u6570\u7684\u542b\u4e49\u975e\u5e38\u660e\u786e\uff0c\u4e0d\u7528\u591a\u4f5c\u89e3\u91ca\u4e86\uff0c\u8fd9\u6837\uff0c\u7528\u6237\u5c31\u53ef\u4ee5\u505a\u5230\u4f7f\u7528yum\u53ea\u4e0b\u8f7d\u8f6f\u4ef6\u5305\uff0c\u4e0d\u81ea\u52a8\u5b89\u88c5\u4e86
\n2.\u4e0d\u7528yum-downloadonly\u63d2\u4ef6\uff0c\u5b89\u88c5\u6216\u8005\u5347\u7ea7\u8f6f\u4ef6\u65f6\u4fdd\u7559\u4e0b\u5b89\u88c5\u5305
\nyum \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5347\u7ea7\u6216\u8005\u5b89\u88c5\u540e\uff0c\u4f1a\u5220\u9664\u4e0b\u8f7d\u7684rpm\u5305\u3002
\n\u4e0d\u8fc7\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5982\u4e0b\u8bbe\u7f6e\u5347\u7ea7\u540e\u4e0d\u5220\u9664\u4e0b\u8f7d\u7684rpm\u5305<\/p>\n

vim \/etc\/yum.conf\r\n[main]\r\ncachedir=\/var\/cache\/yum\r\nkeepcache=0\r\n<\/pre>\n

\u5c06 keepcache=0 \u4fee\u6539\u4e3a keepcache=1\uff0c \u5b89\u88c5\u6216\u8005\u5347\u7ea7\u540e\uff0c\u5728\u76ee\u5f55 \/var\/cache\/yum \u4e0b\u5c31\u4f1a\u6709\u4e0b\u8f7d\u7684 rpm \u5305\u4e86\u3002<\/p>\n

\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/linux-under-various-installation-package.html<\/a>\u7f16\u8f91\uff1a\u9b4f\u4e3d\u733f\uff0c\u5ba1\u6838\u5458\uff1a\u5f20\u5b8f\u5b87<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u6e90\u7801\u5305\u5b89\u88c5 \u5728Linux\u4e0b\u7684\u5f88\u591a\u8f6f\u4ef6\u90fd\u662f\u901a\u8fc7\u6e90\u7801\u5305\u65b9\u5f0f\u53d1\u5e03\u7684\uff0c\u867d\u7136\u76f8\u5bf9\u4e8e\u4e8c\u8fdb\u5236\u8f6f\u4ef6\u5305\uff0c\u914d\u7f6e\u548c\u7f16\u8bd1\u8d77\u6765\u7e41\u7410\u70b9\uff0c\u4f46 […]<\/p>\n","protected":false},"author":317,"featured_media":3864,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-6701","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/6701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/317"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=6701"}],"version-history":[{"count":7,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/6701\/revisions"}],"predecessor-version":[{"id":246032,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/6701\/revisions\/246032"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/3864"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=6701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=6701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=6701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}