Homebrewの最新インストール:インストールタイムアウトの問題を解決

12453 ワード

Homebrew
  • はMac OSX上のパッケージ管理ツールであり、Macでのインストールやソフトウェアのアンインストールが容易である
  • である.
  • Rubyベース
  • は、パッケージを/usr/local/Cellar/の下にインストールし、/usr/local/binの下でシンボルリンク
  • を確立する.
  • コアコンセプト
    語彙
    意味
    formula (e)
    インストールパッケージの記述ファイルformulaeは複数です
    cellar
    インストール後のディレクトリ
    keg
    特定のパッケージが存在するディレクトリ、kegはcellarのサブディレクトリです.
    bottle
    事前にコンパイルしたパッケージは、現場でコンパイルソースをダウンロードする必要がなく、速度が速くなります.公式ライブラリのパッケージの多くはbottle方式でインストールされています
    tap
    ダウンロードソース、Linuxの下のパッケージマネージャrepositoryに類比することができます✨
    cask
    macOS nativeアプリケーションの拡張子をインストールすると、グラフィックインタフェースのあるアプリケーションとしても理解できます.✨
    bundle
    Homebrew依存の拡張を説明する
  • 取付
    #1       :
    $/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    #2         ,    ,       :
    #2.1         :
    $git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
    $git clone git://mirrors.ustc.edu.cn/homebrew-cask.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask --depth=1
    #2.2 homebrew-core brew                
    #        。。      ,      。
    #Linuxbrew   formula      
    $git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
    
    $git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
    # Linuxbrew           
    echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/linuxbrew-bottles' >> ~/.bash_profile
    source ~/.bash_profile
    #2.3   
    $brew update
    
    #2.4   
    $brew install node
    
    
    
  • で発生する可能性のあるエラー:
  • Failed to connect to raw.githubusercontent.com port 443: Connection refused error:
  • #GitHub raw.githubusercontent.com             https://www.ipaddress.com/     ,      ,2020.7.24       
    $sudo vi /etc/hosts 
    #      ,      :
    
    # GitHub     4 
    140.82.114.3      github.com
    199.232.69.194    github.global.ssl.fastly.net
    185.199.110.153   assets-cdn.github.com
    140.82.114.3      gist.github.com
    #192.30.253.119    gist.github.com
    #199.232.28.133    assets-cdn.github.com
    199.232.28.133    raw.githubusercontent.com
    199.232.28.133    gist.githubusercontent.com
    199.232.28.133    cloud.githubusercontent.com
    199.232.28.133    camo.githubusercontent.com
    199.232.28.133    avatars0.githubusercontent.com
    199.232.28.133    avatars1.githubusercontent.com
    199.232.28.133    avatars2.githubusercontent.com
    199.232.28.133    avatars3.githubusercontent.com
    
  • その他のエラー
  • #   Homebrew   :
    $ brew doctor
    
    #   brew.git  :
    $ cd "$(brew --repo)"
    $ git fetch
    $ git reset --hard origin/master
    
    # homebrew-core.git  :
    $ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
    $ git fetch
    $ git reset --hard origin/master
    
    #     :
    $ brew update 
    
  • 更新ソース(次の2つのソースから選択可能)
  • 清華源
  • 中科大源
  • #brew     
    $git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
    #     mac OS      Homebrew 
    #Linuxbrew   formula      (  brew update       )
    
      #1   
      $git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
      #2     (   )
      $git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
      #3  (   )
      $git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://github.com/Homebrew/homebrew-cask-fonts.git
      #4  (   )
    $git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://github.com/Homebrew/homebrew-cask-drivers.git
      #           
      $brew update
    #  Linuxbrew           
       $echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/linuxbrew-bottles' >> ~/.bash_profile
      source ~/.bash_profile
    
  • 復元官方源
    #brew     
     $git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
    #     mac OS      Homebrew       1,2
    #1   
      $git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
    #2     
      $git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
    #3  
      $git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://github.com/Homebrew/homebrew-cask-fonts.git
    #4  
      $git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://github.com/Homebrew/homebrew-cask-drivers.git
    
  • 共通コマンド
    #    : git  
        $brew search git
        #    
        $brew install git
        #     
        $brew rm $FORMULA 
        #      
        $brew uninstall --force $FORMULA 
        #      
        $brew info git
        #          ,    
        $brew deps --installed --tree 
        #    
        $brew update
        #      
        $brew outdated
        #         
        $brew upgrade
        #                 
        $brew cleanup
        #        
        $brew list
        #    
        $brew uninstall git
        #         
        $brew cleanup
        #        
        $brew pin $FORMULA  
        #    
        $brew unpin $FORMULA   
        
        #    
        $brew cask install      
        #      
        $ brew tap homebrew/cask-fonts  #     ,    ,    
        $ brew cask install font-inconsolata
        #      
        $brew tap homebrew/cask-drivers#     ,    ,    
        $brew cask install xbox360-controller-driver-unofficial
    
  • 常用取付
    #Cakebrew   Homebrew   GUI    ,  Cakebrew  ,                ,     Caskbrew              
    $brew cask install cakebrew
    #launchrocket        Homebrew      ,    ,         tap,       
    $brew tap jimbojsb/launchrocket
    $brew cask install launchrocket