MacBookPro-OSX

修改用户名

sudo hostname macbookpro
sudo scutil --set HostName macbookpro
sudo scutil --set LocalHostName macbookpro

MacPort

安装 MacPort Index

修改更新源

  1. 进入你安装macports的资料夹,比如官方的dmg装出来的是/opt/local/etc/macports
  2. 编辑sources.conf在最底下加入,注释掉其他的源rsync://mirrors.tuna.tsinghua.edu.cn/macports/release/tarballs/ports.tar [default]
  3. 还需要在macports.conf中,修改rsync_server为mirrors.tuna.tsinghua.edu.cn
  4. 还需要在macports.conf中,修改rsync_dir为macports/release/tarballs/base.tar

HomeBrew

安装

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

修改更新源

Homebrew的更新源由三部分组成:

  1. 本体(brew.git)
  2. 核心(homebrew-core.git)
  3. 二进制预编译包(homebrew-bottles)
  4. 需要对这个三个部分,分别进行设置。

清华大学

# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

# 应用生效:
brew update

中国科大

# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

# 应用生效:
brew update

取消Brew更新

export HOMEBREW_NO_AUTO_UPDATE=true

猜你喜欢

转载自www.cnblogs.com/meilong/p/MacBookProOSX.html