จะติดตั้ง Homebrew บน MacOS ได้อย่างไร?
เผยแพร่แล้ว: 2022-01-31
Homebrew คืออะไร?
Homebrew หรือ brew คือ Missing Package Manager สำหรับ MacOS
Homebrew เป็นวิธีที่ easiest and most flexible
ในการติดตั้งเครื่องมือ UNIX ที่ Apple ไม่ได้รวมไว้ใน macOS นอกจากนี้ยังสามารถติดตั้งซอฟต์แวร์ที่ไม่ได้จัดแพ็คเกจสำหรับการกระจาย Linux ไปยังโฮมไดเร็กทอรีของคุณ without requiring sudo
มาเริ่มกันเลย:
- ติดตั้ง Missing Package Manager สำหรับ macOS
- วิธีการติดตั้งและใช้งาน Homebrew บน macOS?
- ติดตั้ง Homebrew บน macOS เพื่อใช้ตัวจัดการแพ็คเกจการชง
- จะติดตั้ง Homebrew บน Mac ได้อย่างไรและทำไมคุณควรทำ
- Homebrew คืออะไรและจะติดตั้งบน Mac OSX ได้อย่างไร
นี่คือคำสั่งในการติดตั้ง Homebrew บน MacOS:
1 |
bash - 3.2 $ / bin / bash - c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
นี่คือผลลัพธ์คอนโซลโดยละเอียด:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
bash - 3.2 $ / bin / bash - c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" == > Checking for ` sudo ` access ( which may request your password ) . . . Password : == > This script will install : / usr / local / bin / brew / usr / local / share / doc / homebrew / usr / local / share / man / man1 / brew . 1 / usr / local / share / zsh / site - functions / _brew / usr / local / etc / bash_completion . d / brew / usr / local / Homebrew == > The following existing directories will be made group writable : / usr / local / bin / brew == > The following existing directories will be made writable by user only : / usr / local / share / zsh / usr / local / share / zsh / site - functions == > The following existing directories will have their owner set to app : / usr / local / bin / brew / usr / local / share / zsh / usr / local / share / zsh / site - functions Press RETURN to continue or any other key to abort : == > / usr / bin / sudo / bin / chmod u + rwx / usr / local / bin / brew / usr / local / share / zsh / usr / local / share / zsh / site - functions == > / usr / bin / sudo / bin / chmod g + rwx / usr / local / bin / brew == > / usr / bin / sudo / bin / chmod go - w / usr / local / share / zsh / usr / local / share / zsh / site - functions == > / usr / bin / sudo / usr / sbin / chown app / usr / local / bin / brew / usr / local / share / zsh / usr / local / share / zsh / site - functions == > / usr / bin / sudo / usr / sbin / chown - R app : admin / usr / local / Homebrew == > Downloading and installing Homebrew . . . remote : Enumerating objects : 55858 , done . remote : Counting objects : 100 % ( 11560 / 11560 ) , done . remote : Total 55858 ( delta 11559 ) , reused 11560 ( delta 11559 ) , pack - reused 44298 Receiving objects : 100 % ( 55858 / 55858 ) , 19.38 MiB | 21.83 MiB / s , done . Resolving deltas : 100 % ( 41131 / 41131 ) , completed with 1581 local objects . From https : //github.com/Homebrew/brew * [ new branch ] dependabot / bundler / Library / Homebrew / rbi - 0.0.11 - > origin / dependabot / bundler / Library / Homebrew / rbi - 0.0.11 * [ new branch ] fxcoudert - patch - 1 - > origin / fxcoudert - patch - 1 d5dfe4d6a . . 2ae21a582 master - > origin / master * [ new tag ] 2.4.10 - > 2.4.10 * [ new tag ] 2.4.11 - > 2.4.11 * [ new tag ] 2.4.12 - > 2.4.12 Updating files : 100 % ( 2908 / 2908 ) , done . HEAD is now at 2ae21a582 Merge pull request #12803 from Homebrew/dependabot/bundler/Library/Homebrew/zeitwerk-2.5.4 Updated 1 tap ( homebrew / core ) . == > Installation successful ! == > Homebrew has enabled anonymous aggregate formulae and cask analytics . Read the analytics documentation ( and how to opt - out ) here : https : //docs.brew.sh/Analytics No analytics data has been sent yet ( nor will any be during this install run ) . == > Homebrew is run entirely by unpaid volunteers . Please consider donating : https : //github.com/Homebrew/brew#donations == > Next steps : - Run brew help to get started - Further documentation : https : //docs.brew.sh |
การรับสิทธิ์ถูกปฏิเสธข้อผิดพลาด?

หากคุณได้รับข้อผิดพลาด Permission Denied ให้ทำตามบทช่วยสอนนี้
จะปรับแต่งคำสั่ง Brew ได้อย่างไร?
พิมพ์ command brew help
แล้วคุณจะเห็นผลลัพธ์ดังนี้ ลองตรวจสอบรายการคำสั่งทั้งหมดแล้วคุณจะพบการกำหนดค่าและอัปเดตผลลัพธ์มากมาย บน Mac ของฉัน ฉันติดตั้ง PHP เวอร์ชันล่าสุดโดยใช้ homebrew เท่านั้น
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
bash - 3.2 $ brew help Example usage : brew search TEXT | / REGEX / brew info [ FORMULA | CASK . . . ] brew install FORMULA | CASK . . . brew update brew upgrade [ FORMULA | CASK . . . ] brew uninstall FORMULA | CASK . . . brew list [ FORMULA | CASK . . . ] Troubleshooting : brew config brew doctor brew install -- verbose -- debug FORMULA | CASK Contributing : brew create URL [ -- no - fetch ] brew edit [ FORMULA | CASK . . . ] Further help : brew commands brew help [ COMMAND ] man brew https : //docs.brew.sh |
ตรวจสอบผลลัพธ์คำสั่ง "brew config":
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
bash - 3.2 $ brew config HOMEBREW_VERSION : 3.3.12 ORIGIN : https : //github.com/Homebrew/brew HEAD : 768b172393339b4654107dc6a840a2cd08dc64b9 Last commit : 9 days ago Core tap ORIGIN : https : //github.com/Homebrew/homebrew-core Core tap HEAD : bc7dd6ce5ab03dc49e2207c9d5f16b27ef0893c3 Core tap last commit : 55 minutes ago Core tap branch : master HOMEBREW_PREFIX : / usr / local HOMEBREW_CASK_OPTS : [ ] HOMEBREW_CORE_GIT_REMOTE : https : //github.com/Homebrew/homebrew-core HOMEBREW_MAKE_JOBS : 16 Homebrew Ruby : 2.6.8 = > / System / Library / Frameworks / Ruby . framework / Versions / 2.6 / usr / bin / ruby CPU : 16 - core 64 - bit kabylake Clang : 11.0.3 build 1103 Git : 2.24.3 = > / Library / Developer / CommandLineTools / usr / bin / git Curl : 7.79.1 = > / usr / bin / curl macOS : 12.3 - x86_64 CLT : 11.3.0.32.62 Xcode : N / A |
นี่คือผลลัพธ์ของคำสั่ง "man brew":
ผลลัพธ์ man brew
:

ฉันหวังว่านี่จะช่วยได้. แจ้งให้เราทราบหากคุณประสบปัญหาในการติดตั้ง Homebrew บน MacOS
มีความสุขในการเข้ารหัส