最近走教育优惠 → 2022年苹果教育优惠 Mac全系购买指南渠道 终于把用了5年的17款mac换到二线了,但是迁移到新Mac上 → 使用迁移助理将内容迁移到一台新的 Mac 上 发现之前老系统python2.7和php都被移除了,有些脚本跑不起来,只能去网上搜搜,重新装上。mark一下,给有需要的人。
安装python2.7
Homebrew替换为国内地址
苹果电脑 常规安装脚本(推荐 完全体 几分钟安装完成): /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" 苹果电脑 极速安装脚本(精简版 几秒钟安装完成): /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)" speed 苹果电脑 卸载脚本: /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)" 常见错误去下方地址查看 https://gitee.com/cunkai/HomebrewCN/blob/master/error.md Linux电脑 安装脚本: rm Homebrew.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh ; bash Homebrew.sh Linux电脑 卸载脚本: rm HomebrewUninstall.sh ; wget https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh ; bash HomebrewUninstall.sh
使用homwbrew安装包工具安装php,nginx,mysql
# 安装php brew install php # 安装nginx brew install nginx # 安装mysql brew install mysql # 启动、关闭和重启php、mysql服务分别使用 brew services start|stop|restart php/mysql # 而nginx的服务设置因为涉及系统底层文件,需要在命令行前面加上sudo sudo brew services start|stop|restart nginx
Mac M1 Brew install 报错Command failed with exit 128:git
$ brew install redis fatal: not in a git directory Error: Command failed with exit 128: git # 输入 brew -v 会提示执行两个配置命令,直接复制执行就行了 $ brew -v Homebrew 3.5.9-108-g5047d42 fatal: unsafe repository ('/opt/homebrew/Library/Taps/homebrew/homebrew-core' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core Homebrew/homebrew-core (no Git repository) fatal: unsafe repository ('/opt/homebrew/Library/Taps/homebrew/homebrew-cask' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask Homebrew/homebrew-cask (no Git repository)
整理自: