{"id":100,"date":"2025-07-16T10:42:35","date_gmt":"2025-07-16T02:42:35","guid":{"rendered":"https:\/\/www.hgfwq.com\/blog\/?p=100"},"modified":"2025-07-16T10:42:35","modified_gmt":"2025-07-16T02:42:35","slug":"%e8%a7%a3%e5%86%b3curl%ef%bc%9a-command-not-found%e9%97%ae%e9%a2%98%e7%9a%84%e4%b8%89%e5%a4%a7%e6%ad%a5%e9%aa%a4%e4%b8%8e%e9%a2%84%e9%98%b2%e6%8e%aa%e6%96%bd","status":"publish","type":"post","link":"https:\/\/www.hgfwq.com\/blog\/100.html","title":{"rendered":"\u89e3\u51b3`curl\uff1a command not found`\u95ee\u9898\u7684\u4e09\u5927\u6b65\u9aa4\u4e0e\u9884\u9632\u63aa\u65bd"},"content":{"rendered":"<p><h>\u4ec0\u4e48\u662f`curl: command not found`\u9519\u8bef\uff1f<\/h><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.hgfwq.com\/blog\/wp-content\/uploads\/2025\/07\/8PC5qer3.jpg\" alt=\"\u89e3\u51b3`curl\uff1a command not found`\u95ee\u9898\u7684\u4e09\u5927\u6b65\u9aa4\u4e0e\u9884\u9632\u63aa\u65bd\" title=\"\u89e3\u51b3`curl\uff1a command not found`\u95ee\u9898\u7684\u4e09\u5927\u6b65\u9aa4\u4e0e\u9884\u9632\u63aa\u65bd\"><\/p>\n<p><p>\u5f53\u4f60\u5728Linux\u7cfb\u7edf\u6216MacOS\u7684\u7ec8\u7aef\u4e2d\u5c1d\u8bd5\u8fd0\u884c`curl`\u547d\u4ee4\uff0c\u4f46\u7cfb\u7edf\u63d0\u793a`curl: command not found`\u65f6\uff0c\u8fd9\u610f\u5473\u7740\u7cfb\u7edf\u65e0\u6cd5\u5728\u5f53\u524d\u7684shell\u73af\u5883\u4e2d\u627e\u5230`curl`\u547d\u4ee4\u3002\u8fd9\u901a\u5e38\u662f\u56e0\u4e3a`curl`\u6ca1\u6709\u5b89\u88c5\u5728\u7cfb\u7edf\u4e0a\uff0c\u6216\u8005\u6ca1\u6709\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684PATH\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/p>\n<\/p>\n<p><h>\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0`curl: command not found`\u9519\u8bef\uff1f<\/h><\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u53ef\u80fd\u5bfc\u81f4`curl: command not found`\u9519\u8bef\u7684\u539f\u56e0\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u7cfb\u7edf\u6ca1\u6709\u5b89\u88c5curl\u3002\u867d\u7136curl\u901a\u5e38\u88ab\u5305\u542b\u5728\u5927\u591a\u6570Linux\u53d1\u884c\u7248\u7684\u9ed8\u8ba4\u5b89\u88c5\u4e2d\uff0c\u4f46\u67d0\u4e9b\u7cfb\u7edf\u53ef\u80fd\u9700\u8981\u624b\u52a8\u5b89\u88c5\u3002<\/li>\n<li>curl\u5b89\u88c5\u540e\uff0c\u6ca1\u6709\u6b63\u786e\u6dfb\u52a0\u5230PATH\u73af\u5883\u53d8\u91cf\u4e2d\u3002PATH\u73af\u5883\u53d8\u91cf\u662f\u4e00\u4e2a\u5305\u542b\u7cfb\u7edf\u547d\u4ee4\u8def\u5f84\u7684\u5217\u8868\uff0cshell\u4f1a\u5728\u8fd9\u4e2a\u5217\u8868\u4e2d\u67e5\u627e\u547d\u4ee4\u3002<\/li>\n<li>curl\u7684\u5b89\u88c5\u8def\u5f84\u4e0d\u5728PATH\u53d8\u91cf\u4e2d\uff0c\u6216\u8005\u7cfb\u7edf\u4e2d\u5b58\u5728\u591a\u4e2acurl\u7248\u672c\uff0c\u800cPATH\u4e2d\u6307\u5411\u7684\u4e0d\u662f\u5f53\u524d\u7248\u672c\u3002<\/li>\n<\/ol>\n<p><h>\u5982\u4f55\u89e3\u51b3`curl: command not found`\u9519\u8bef\uff1f<\/h><\/p>\n<p><p>\u4ee5\u4e0b\u662f\u89e3\u51b3`curl: command not found`\u9519\u8bef\u7684\u8be6\u7ec6\u6307\u5357\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u68c0\u67e5curl\u662f\u5426\u5df2\u5b89\u88c5<\/strong><\/li>\n<p><p>\u5728\u5927\u591a\u6570Linux\u53d1\u884c\u7248\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u6765\u68c0\u67e5curl\u662f\u5426\u5df2\u5b89\u88c5\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7cfb\u7edf\u7684\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u57fa\u4e8eDebian\u7684\u7cfb\u7edf\uff08\u5982Ubuntu\uff09\u4e2d\uff0c\u4f7f\u7528\uff1a<\/li>\n<li><code>sudo apt-get install curl<\/code><\/li>\n<li>\u5728\u57fa\u4e8eRPM\u7684\u7cfb\u7edf\uff08\u5982CentOS\uff09\u4e2d\uff0c\u4f7f\u7528\uff1a<\/li>\n<li><code>sudo yum install curl<\/code><\/li>\n<li>\u5728Fedora\u4e2d\uff0c\u4f7f\u7528\uff1a<\/li>\n<li><code>sudo dnf install curl<\/code><\/li>\n<\/ul>\n<li><strong>\u68c0\u67e5PATH\u73af\u5883\u53d8\u91cf<\/strong><\/li>\n<p><p>\u6253\u5f00\u4f60\u7684\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u67e5\u770bPATH\u53d8\u91cf\uff1a<\/p>\n<\/p>\n<li><code>echo $PATH<\/code><\/li>\n<p><p>\u5982\u679c\u4f60\u5728PATH\u53d8\u91cf\u4e2d\u770b\u4e0d\u5230curl\u7684\u5b89\u88c5\u8def\u5f84\uff0c\u4f60\u9700\u8981\u5c06\u5176\u6dfb\u52a0\u5230PATH\u4e2d\u3002<\/p>\n<\/p>\n<li><strong>\u6dfb\u52a0curl\u5230PATH\u73af\u5883\u53d8\u91cf<\/strong><\/li>\n<p><p>\u4ee5\u4e0b\u662f\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0b\u6dfb\u52a0curl\u5230PATH\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u7f16\u8f91\u4f60\u7684shell\u914d\u7f6e\u6587\u4ef6\uff08\u5982.bashrc\u6216.zshrc\uff09\uff0c\u7136\u540e\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/li>\n<li><code>export PATH=\"$PATH:\/path\/to\/curl\/installation\/directory\"<\/code><\/li>\n<li>\u5728MacOS\u4e2d\uff0c\u7f16\u8f91\u4f60\u7684shell\u914d\u7f6e\u6587\u4ef6\uff08\u5982.bash_profile\u6216.bashrc\uff09\uff0c\u7136\u540e\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/li>\n<li><code>export PATH=\"$PATH:\/path\/to\/curl\/installation\/directory\"<\/code><\/li>\n<li>\u4fdd\u5b58\u6587\u4ef6\u5e76\u9000\u51fa\u7f16\u8f91\u5668\u3002<\/li>\n<li>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\u6216\u91cd\u542f\u7ec8\u7aef\uff1a<\/li>\n<li><code>source ~\/.bashrc<\/code> \u6216 <code>source ~\/.zshrc<\/code><\/li>\n<\/ul>\n<li><strong>\u9a8c\u8bc1curl\u662f\u5426\u53ef\u7528<\/strong><\/li>\n<p><p>\u73b0\u5728\uff0c\u5c1d\u8bd5\u518d\u6b21\u8fd0\u884ccurl\u547d\u4ee4\uff0c\u770b\u770b\u662f\u5426\u8fd8\u80fd\u770b\u5230\u9519\u8bef\uff1a<\/p>\n<\/p>\n<li><code>curl --version<\/code><\/li>\n<p><p>\u5982\u679ccurl\u6b63\u786e\u5b89\u88c5\u5e76\u6dfb\u52a0\u5230PATH\uff0c\u8fd9\u4e2a\u547d\u4ee4\u5e94\u8be5\u4f1a\u8f93\u51facurl\u7684\u7248\u672c\u4fe1\u606f\u3002<\/p>\n<\/p>\n<\/ol>\n<p><h>\u5982\u4f55\u9632\u6b62`curl: command not found`\u9519\u8bef\u518d\u6b21\u53d1\u751f\uff1f<\/h><\/p>\n<p><p>\u4e3a\u4e86\u9632\u6b62\u672a\u6765\u518d\u6b21\u51fa\u73b0`curl: command not found`\u9519\u8bef\uff0c\u4f60\u53ef\u4ee5\u91c7\u53d6\u4ee5\u4e0b\u63aa\u65bd\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u786e\u4fdd\u5728\u670d\u52a1\u5668\u6216VPS\u4e0a\u5b89\u88c5\u4e86curl\uff0c\u5e76\u4e14\u5b83\u662f\u53ef\u7528\u7684\u3002<\/li>\n<li>\u5728\u914d\u7f6e\u65b0\u670d\u52a1\u5668\u6216VPS\u65f6\uff0c\u786e\u4fdd\u5c06curl\u6dfb\u52a0\u5230PATH\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/li>\n<li>\u5b9a\u671f\u68c0\u67e5\u4f60\u7684PATH\u73af\u5883\u53d8\u91cf\uff0c\u786e\u4fdd\u5b83\u5305\u542b\u6240\u6709\u5fc5\u8981\u7684\u547d\u4ee4\u8def\u5f84\u3002<\/li>\n<\/ol>\n<p><h>\u95ee\u7b54\u73af\u8282<\/h><\/p>\n<p><p><b>\u95ee\u98981\uff1a<\/b>\u5982\u679c\u6211\u5728Linux\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u4e86curl\uff0c\u4f46\u4ecd\u7136\u770b\u5230`curl: command not found`\u9519\u8bef\uff0c\u8be5\u600e\u4e48\u529e\uff1f<\/p>\n<\/p>\n<p><p>\u4f60\u53ef\u80fd\u9700\u8981\u68c0\u67e5PATH\u73af\u5883\u53d8\u91cf\u662f\u5426\u6b63\u786e\u8bbe\u7f6e\u4e86curl\u7684\u5b89\u88c5\u8def\u5f84\u3002\u4f7f\u7528`echo $PATH`\u547d\u4ee4\u6765\u67e5\u770bPATH\u53d8\u91cf\uff0c\u5e76\u786e\u4fdd\u5176\u4e2d\u5305\u542b\u4e86curl\u7684\u5b89\u88c5\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><p><b>\u95ee\u98982\uff1a<\/b>\u6211\u4f7f\u7528\u7684\u662fMacOS\uff0c\u4e3a\u4ec0\u4e48\u6211\u8fd8\u662f\u770b\u5230\u4e86`curl: command not found`\u9519\u8bef\uff1f<\/p>\n<\/p>\n<p><p>\u5728MacOS\u4e2d\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u68c0\u67e5\u4f60\u7684shell\u914d\u7f6e\u6587\u4ef6\uff08\u5982.bash_profile\u6216.bashrc\uff09\uff0c\u5e76\u786e\u4fdd\u5728\u5176\u4e2d\u6dfb\u52a0\u4e86\u6b63\u786e\u7684curl\u5b89\u88c5\u8def\u5f84\u5230PATH\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/p>\n<\/p>\n<p><p><b>\u95ee\u98983\uff1a<\/b>\u6211\u66f4\u65b0\u4e86PATH\u73af\u5883\u53d8\u91cf\uff0c\u4f46curl\u4ecd\u7136\u4e0d\u53ef\u7528\uff0c\u4e3a\u4ec0\u4e48\uff1f<\/p>\n<\/p>\n<p><p>\u786e\u4fdd\u4f60\u6b63\u786e\u5730\u4fdd\u5b58\u4e86shell\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u4e14\u4f7f\u7528\u4e86\u6b63\u786e\u7684\u547d\u4ee4\u6765\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\uff08\u5982`source ~\/.bashrc`\uff09\u3002\u6b64\u5916\uff0c\u68c0\u67e5\u662f\u5426\u6709\u591a\u4e2a\u7248\u672c\u7684curl\uff0c\u786e\u4fddPATH\u6307\u5411\u7684\u662f\u6b63\u786e\u7684\u7248\u672c\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662f`curl: command not found`\u9519\u8bef\uff1f \u5f53\u4f60\u5728Linux\u7cfb\u7edf\u6216MacOS\u7684\u7ec8\u7aef\u4e2d\u5c1d\u8bd5\u8fd0\u884c`curl`\u547d\u4ee4\uff0c\u4f46\u7cfb\u7edf\u63d0\u793a`curl: command not found`\u65f6\uff0c\u8fd9\u610f\u5473\u7740\u7cfb\u7edf\u65e0\u6cd5\u5728\u5f53\u524d\u7684shell\u73af\u5883\u4e2d\u627e\u5230`&#8230;<\/p>\n","protected":false},"author":1,"featured_media":101,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[61,45,46],"topic":[],"class_list":["post-100","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-haiwai","tag-command","tag-curl","tag-found"],"_links":{"self":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/comments?post=100"}],"version-history":[{"count":1,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":103,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts\/100\/revisions\/103"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/media\/101"}],"wp:attachment":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/media?parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/categories?post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/tags?post=100"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/topic?post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}