{"id":16602,"date":"2024-11-18T15:45:30","date_gmt":"2024-11-18T07:45:30","guid":{"rendered":"https:\/\/fwq.ai\/blog\/16602\/"},"modified":"2024-11-18T15:45:30","modified_gmt":"2024-11-18T07:45:30","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8linux%e8%bf%9b%e8%a1%8c%e8%bd%af%e4%bb%b6%e5%8c%85%e5%ae%89%e8%a3%85%e5%92%8c%e6%9b%b4%e6%96%b0","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/16602\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528Linux\u8fdb\u884c\u8f6f\u4ef6\u5305\u5b89\u88c5\u548c\u66f4\u65b0"},"content":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528\u8fdb\u884c\u8f6f\u4ef6\u5305\u5b89\u88c5\u548c\u66f4\u65b0<\/p>\n<p>\u4e00\u3001\u5f15\u8a00<br \/>Linux\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b83\u4ee5\u5176\u9ad8\u5ea6\u7075\u6d3b\u3001\u5b89\u5168\u4e14\u7a33\u5b9a\u7684\u7279\u70b9\u800c\u95fb\u540d\u4e8e\u4e16\u3002\u5728Linux\u4e2d\uff0c\u8f6f\u4ef6\u5305\u7684\u5b89\u88c5\u548c\u66f4\u65b0\u662f\u4e00\u9879\u975e\u5e38\u91cd\u8981\u7684\u4efb\u52a1\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Linux\u8fdb\u884c\u8f6f\u4ef6\u5305\u7684\u5b89\u88c5\u548c\u66f4\u65b0\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e9b\u4ee3\u7801\u793a\u4f8b\u4ee5\u4f9b\u53c2\u8003\u3002<\/p>\n<p>\u4e8c\u3001\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668<br \/>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u5e38\u7528\u7684\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\u5305\u62ec\uff1a<\/p>\n<ol>\n<li>Debian\u53ca\u5176\u884d\u751f\u7248\u672c\uff08\u5982Ubuntu\uff09\uff1aapt-get\u3001apt<\/li>\n<li>Red Hat\u53ca\u5176\u884d\u751f\u7248\u672c\uff08\u5982Fedora\u3001CentOS\uff09\uff1ayum\u3001dnf<\/li>\n<li>SUSE Linux\u53ca\u5176\u884d\u751f\u7248\u672c\uff1azypper<\/li>\n<li>Arch Linux\u53ca\u5176\u884d\u751f\u7248\u672c\uff1apacman<br \/>\u672c\u6587\u5c06\u4ee5Debian\u53ca\u5176\u884d\u751f\u7248\u672c\uff08\u5982Ubuntu\uff09\u4e3a\u4f8b\u8fdb\u884c\u8bf4\u660e\u3002<\/li>\n<\/ol>\n<p>\u4e09\u3001\u8f6f\u4ef6\u5305\u5b89\u88c5<\/p>\n<ol>\n<li>\n<p>\u4f7f\u7528apt-get\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<pre>sudo apt-get install package_name<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u5b89\u88c5\u5e38\u7528\u7684\u6587\u672c\u7f16\u8f91\u5668Vim\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>sudo apt-get install vim<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p>\u4f7f\u7528apt\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<pre>sudo apt install package_name<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4e0eapt-get\u76f8\u6bd4\uff0capt\u547d\u4ee4\u63d0\u4f9b\u4e86\u66f4\u53cb\u597d\u7684\u7528\u6237\u754c\u9762\u3002\u4f8b\u5982\uff0c\u4ee5\u4e0a\u9762\u7684Vim\u4e3a\u4f8b\uff1a<\/p>\n<pre>sudo apt install vim<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u65e0\u8bba\u662f\u4f7f\u7528apt-get\u8fd8\u662fapt\u547d\u4ee4\uff0c\u7cfb\u7edf\u90fd\u4f1a\u81ea\u52a8\u89e3\u51b3\u8f6f\u4ef6\u5305\u4e4b\u95f4\u7684\u4f9d\u8d56\u5173\u7cfb\u3002\u5982\u679c\u5176\u4ed6\u8f6f\u4ef6\u5305\u662f\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u9879\uff0c\u7cfb\u7edf\u5c06\u4f1a\u81ea\u52a8\u5b89\u88c5\u8fd9\u4e9b\u4f9d\u8d56\u9879\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u56db\u3001\u8f6f\u4ef6\u5305\u66f4\u65b0<\/p>\n<ol>\n<li>\n<p>\u4f7f\u7528apt-get\u547d\u4ee4\u8fdb\u884c\u66f4\u65b0\uff1a<\/p>\n<pre>sudo apt-get update\nsudo apt-get upgrade<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u9996\u5148\u8fd0\u884capt-get update\u547d\u4ee4\uff0c\u5b83\u4f1a\u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868\u3002\u7136\u540e\u8fd0\u884capt-get upgrade\u547d\u4ee4\uff0c\u5b83\u4f1a\u5347\u7ea7\u6240\u6709\u53ef\u7528\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528apt\u547d\u4ee4\u8fdb\u884c\u66f4\u65b0\uff1a<\/p>\n<pre>sudo apt update\nsudo apt upgrade<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4e0eapt-get\u76f8\u6bd4\uff0capt\u547d\u4ee4\u63d0\u4f9b\u4e86\u66f4\u53cb\u597d\u7684\u7528\u6237\u754c\u9762\u3002\u8fd0\u884c\u4ee5\u4e0a\u4e24\u4e2a\u547d\u4ee4\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5347\u7ea7\u6240\u6709\u53ef\u7528\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u547d\u4ee4\u4f1a\u5c06\u7cfb\u7edf\u4e2d\u7684\u8f6f\u4ef6\u5305\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3002\u5982\u679c\u7cfb\u7edf\u4e2d\u6709\u4e00\u4e9b\u7279\u5b9a\u8f6f\u4ef6\u5305\u4e0d\u5e0c\u671b\u88ab\u5347\u7ea7\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u5f0f\u8fdb\u884c\u9650\u5236\u3002<\/p>\n<ol>\n<li>\n<p>\u4f7f\u7528apt-mark\u547d\u4ee4\u8fdb\u884c\u4fdd\u6301\u8f6f\u4ef6\u5305\u4e0d\u5347\u7ea7\uff1a<\/p>\n<pre>sudo apt-mark hold package_name<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u4fdd\u6301Vim\u8f6f\u4ef6\u5305\u4e0d\u5347\u7ea7\uff1a<\/p>\n<pre>sudo apt-mark hold vim<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p>\u4f7f\u7528apt-mark\u547d\u4ee4\u8fdb\u884c\u89e3\u9664\u4fdd\u6301\uff1a<\/p>\n<pre>sudo apt-mark unhold package_name<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u89e3\u9664\u5bf9Vim\u8f6f\u4ef6\u5305\u7684\u4fdd\u6301\uff1a<\/p>\n<pre>sudo apt-mark unhold vim<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ol>\n<p>\u4e94\u3001\u5176\u4ed6\u5e38\u7528\u547d\u4ee4<\/p>\n<ol>\n<li>\n<p>\u5b89\u88c5\u8f6f\u4ef6\u5305\u6e90\uff1a<br \/>\u6709\u65f6\u5019\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u7684\u8f6f\u4ef6\u6e90\u4e0d\u5305\u542b\u6240\u9700\u7684\u8f6f\u4ef6\u5305\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6dfb\u52a0\u989d\u5916\u7684\u8f6f\u4ef6\u6e90\uff1a<\/p>\n<pre>sudo add-apt-repository repository_name<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p>\u641c\u7d22\u8f6f\u4ef6\u5305\uff1a<br \/>\u8981\u641c\u7d22\u7279\u5b9a\u7684\u8f6f\u4ef6\u5305\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>apt-cache search keyword<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u641c\u7d22\u540d\u4e3a&#8221;apache&#8221;\u7684\u8f6f\u4ef6\u5305\uff1a<\/p>\n<pre>apt-cache search apache<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<li>\n<p>\u5220\u9664\u8f6f\u4ef6\u5305\uff1a<br \/>\u8981\u5220\u9664\u4e0d\u9700\u8981\u7684\u8f6f\u4ef6\u5305\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>sudo apt-get remove package_name<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u5220\u9664Apache\u8f6f\u4ef6\u5305\uff1a<\/p>\n<pre>sudo apt-get remove apache2<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ol>\n<p>\u516d\u3001\u603b\u7ed3<br \/>\u672c\u6587\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528Linux\u8fdb\u884c\u8f6f\u4ef6\u5305\u7684\u5b89\u88c5\u548c\u66f4\u65b0\uff0c\u5e76\u63d0\u4f9b\u4e86\u76f8\u5173\u7684\u4ee3\u7801\u793a\u4f8b\u3002\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d\uff0c\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u9009\u62e9\u5408\u9002\u7684\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u548c\u547d\u4ee4\u8fdb\u884c\u64cd\u4f5c\u3002\u540c\u65f6\uff0c\u8fd8\u4ecb\u7ecd\u4e86\u5e38\u7528\u7684\u5176\u4ed6\u547d\u4ee4\uff0c\u5982\u6dfb\u52a0\u8f6f\u4ef6\u5305\u6e90\u3001\u641c\u7d22\u8f6f\u4ef6\u5305\u548c\u5220\u9664\u8f6f\u4ef6\u5305\u7b49\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\uff0c\u8ba9\u60a8\u66f4\u597d\u5730\u4f7f\u7528Linux\u8fdb\u884c\u8f6f\u4ef6\u5305\u7ba1\u7406\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f7f\u7528Linux\u8fdb\u884c\u8f6f\u4ef6\u5305\u5b89\u88c5\u548c\u66f4\u65b0\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528\u8fdb\u884c\u8f6f\u4ef6\u5305\u5b89\u88c5\u548c\u66f4\u65b0 \u4e00\u3001\u5f15\u8a00Linux\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b83\u4ee5\u5176\u9ad8\u5ea6\u7075\u6d3b\u3001\u5b89\u5168\u4e14\u7a33\u5b9a\u7684\u7279\u70b9\u800c\u95fb\u540d\u4e8e\u4e16\u3002\u5728Linux\u4e2d\uff0c\u8f6f\u4ef6\u5305\u7684\u5b89\u88c5\u548c\u66f4\u65b0\u662f\u4e00\u9879\u975e\u5e38\u91cd\u8981\u7684\u4efb\u52a1\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Linux\u8fdb\u884c\u8f6f\u4ef6\u5305\u7684\u5b89\u88c5\u548c\u66f4\u65b0\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e9b\u4ee3\u7801\u793a\u4f8b\u4ee5\u4f9b\u53c2\u8003\u3002 \u4e8c\u3001\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u5e38\u7528\u7684\u8f6f\u4ef6\u5305\u7ba1\u7406\u5de5\u5177\u5305\u62ec\uff1a Debian\u53ca\u5176\u884d\u751f\u7248\u672c\uff08\u5982Ubuntu\uff09\uff1aapt-get\u3001apt Red Hat\u53ca\u5176\u884d\u751f\u7248\u672c\uff08\u5982Fedora\u3001CentOS\uff09\uff1ayum\u3001dnf SUSE Linux\u53ca\u5176\u884d\u751f\u7248\u672c\uff1azypper Arch Linux\u53ca\u5176\u884d\u751f\u7248\u672c\uff1apacman\u672c\u6587\u5c06\u4ee5Debian\u53ca\u5176\u884d\u751f\u7248\u672c\uff08\u5982Ubuntu\uff09\u4e3a\u4f8b\u8fdb\u884c\u8bf4\u660e\u3002 \u4e09\u3001\u8f6f\u4ef6\u5305\u5b89\u88c5 \u4f7f\u7528apt-get\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a sudo apt-get install package_name \u767b\u5f55\u540e\u590d\u5236 \u4f8b\u5982\uff0c\u8981\u5b89\u88c5\u5e38\u7528\u7684\u6587\u672c\u7f16\u8f91\u5668Vim\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a sudo apt-get install vim \u767b\u5f55\u540e\u590d\u5236 \u4f7f\u7528apt\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a sudo apt install package_name \u767b\u5f55\u540e\u590d\u5236 \u4e0eapt-get\u76f8\u6bd4\uff0capt\u547d\u4ee4\u63d0\u4f9b\u4e86\u66f4\u53cb\u597d\u7684\u7528\u6237\u754c\u9762\u3002\u4f8b\u5982\uff0c\u4ee5\u4e0a\u9762\u7684Vim\u4e3a\u4f8b\uff1a sudo apt install vim \u767b\u5f55\u540e\u590d\u5236 \u65e0\u8bba\u662f\u4f7f\u7528apt-get\u8fd8\u662fapt\u547d\u4ee4\uff0c\u7cfb\u7edf\u90fd\u4f1a\u81ea\u52a8\u89e3\u51b3\u8f6f\u4ef6\u5305\u4e4b\u95f4\u7684\u4f9d\u8d56\u5173\u7cfb\u3002\u5982\u679c\u5176\u4ed6\u8f6f\u4ef6\u5305\u662f\u5b89\u88c5\u6240\u9700\u7684\u4f9d\u8d56\u9879\uff0c\u7cfb\u7edf\u5c06\u4f1a\u81ea\u52a8\u5b89\u88c5\u8fd9\u4e9b\u4f9d\u8d56\u9879\u3002 \u56db\u3001\u8f6f\u4ef6\u5305\u66f4\u65b0 \u4f7f\u7528apt-get\u547d\u4ee4\u8fdb\u884c\u66f4\u65b0\uff1a sudo apt-get update sudo apt-get upgrade \u767b\u5f55\u540e\u590d\u5236 \u9996\u5148\u8fd0\u884capt-get update\u547d\u4ee4\uff0c\u5b83\u4f1a\u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868\u3002\u7136\u540e\u8fd0\u884capt-get upgrade\u547d\u4ee4\uff0c\u5b83\u4f1a\u5347\u7ea7\u6240\u6709\u53ef\u7528\u7684\u8f6f\u4ef6\u5305\u3002 \u4f7f\u7528apt\u547d\u4ee4\u8fdb\u884c\u66f4\u65b0\uff1a sudo apt update sudo apt upgrade [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-16602","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/16602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=16602"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/16602\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=16602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=16602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=16602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}