首页 > 其他分享 >Mac/HomeBrew的常见问题

Mac/HomeBrew的常见问题

时间:2023-02-18 17:56:10浏览次数:52  
标签:常见问题 -- Mac file homebrew brew HomeBrew zsh bash

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/HomebrewUninstall.sh)"

版本更新

brew update-reset

版本信息

brew -v

有图形界面的软件安装

brew install --cask 软件名

软件名查询

brew search 软件名

卸载软件

brew uninstall 软件名

删除垃圾

rm -rf "$(brew --cache)" && brew cleanup

微信插件安装

配合 alfred 的使用,有微信多开 防撤回功能

首次使用安装 WeChatTweak-CLI:

 brew install sunnyyoung/repo/wechattweak-cli

安装/更新/卸载 Tweak:

$ sudo wechattweak-cli install   # 安装/更新
$ sudo wechattweak-cli uninstall # 卸载

Bug

brew install 时 出现 Error: Command failed with exit 128: git 问题

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask

Mac 解决安装brew卡在 “Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core‘...”

cd /usr/local/Homebrew/Library/Taps/
mkdir homebrew
cd homebrew
git clone https://mirrors.ustc.edu.cn/homebrew-core.git
brew update

安装内容报错

Error: [email protected] has been disabled because it is a versioned formula!
  1. 首先找到文件

/opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/[email protected]

  1. 找到disabel这一行,然后注释掉(就是在前面加个#);

# disable! date: "2022-11-28", because: :versioned_formula

  1. 重新安装

Mac

Mac打开全部来源

sudo spctl --master-disable

Mac自带终端代码高亮 补全

高亮: fast-syntax-highlighting

brew install fast-syntax-highlighting

补全: zsh-autosuggestions

brew install zsh-autosuggestions

.zshrc文件添加配置

#代码高亮
source /opt/homebrew/Cellar/zsh-fast-syntax-highlighting/1.55/share/zsh-fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh

#代码补全

source /opt/homebrew/Cellar/zsh-autosuggestions/0.7.0/share/zsh-autosuggestions/zsh-autosuggestions.zsh

软件损坏请移至废纸篓

方案1

此选项将允许您绕过特定应用程序的隔离。请注意,该命令包括应用程序或图像(.dmg)的路径。
这个过程通常被称为“去隔离”或“去隔离”。

  1. 使用以下命令:sudo xattr -r -d com.apple.quarantine 放置一个空格并将损坏的程序或图像 (.dmg) 拖入终端窗口。团队将完成。

  2. 或者使用命令:sudo xattr -r -c 放置一个空格并将损坏的程序或图像(.dmg)拖入终端窗口。团队将完成。
    通常,仅使用第一个命令就足够了,但在某些情况下,它的执行没有帮助,这与执行第二个命令不同。

  3. 开始启动损坏的程序。

等待支票完成,你将能够打开它。

验证时间最多可能需要 30 分钟。

方案2

此命令将允许您禁用门禁,即恢复允许在系统偏好设置/保护和安全性中使用从任何来源下载的程序的设置。

  1. 使用命令:sudo spctl --master-disable

    您无需将任何东西拖到终端。要启用门禁,请将“禁用”替换为“启用”。

终端命令行 E325: ATTENTION

E325: ATTENTION
Found a swap file by the name ".bash_profile.swp"
          owned by: root   dated: Fri Aug 25 16:23:42 2017
         file name: ~root/.bash_profile
          modified: no
         user name: root   host name: h********deMacBook-Pro.local
        process ID: 5025 (still running)
While opening file ".bash_profile"
 
(1) Another program may be editing the same file.  If this is the case,
    be careful not to end up with two different instances of the same
    file when making changes.  Quit, or continue with caution.
(2) An edit session for this file crashed.
    If this is the case, use ":recover" or "vim -r .bash_profile"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file ".bash_profile.swp"
    to avoid this message.

非正常关闭vim/vi在编辑的文件时会创建一个交换文件.swp 文件以保证文件的安全性
我们只要将这个文件删除就OK了

rm -f  .bash_profile.swp

command not found: vim

因为vim正在能在任何路径下运行的指令肯定是在PATH路径下有配置,你后加了什么新的路径到PATH里如果写错了那就整个PATH里的所有都用不了了

将配置文件(bash_profile) 的内容修改正确

标签:常见问题,--,Mac,file,homebrew,brew,HomeBrew,zsh,bash
From: https://www.cnblogs.com/Bikakaso/p/machomebrew.html

相关文章

  • Premiere Pro 2021 for Mac(pr 2021) 15.4.1中文特别版
    PremierePro2021forMac是一款强大的视频编辑软件。Premiere功能强大,为您提供采集,剪辑,添加字幕等功能于一体,满足您的工作要求,让你制作出高品质的作品。视频处理软件Premi......
  • IDEA修改Java注释字体颜色 - mac电脑 - 2023年2月
    先来看下成果: 先选中Preferences: 再选择Editor->Java->Comments->Blockcomment(多行注释)或者Linecomment(单行注释)  end.......
  • 【Node】mac 安装n进行node版本管理
    安装清除node缓存:sudonpmcacheclean-f安装n执行:npminstalln-g注意:如果报错如:codeEACCES errno-13,表示你没有权限安装,使用管理员身份安装:sudonpm......
  • MacOS安装软件用brew install遇到443的问题如何解决github.com
    1 443的报错一般都是属于域名解析问题,或者墙的问题   2首先解决墙的问题 这个不展开讲了     3如果能够ping通域名了,brewinstall还是443就把自......
  • m1芯片mac安装homebrew
    安装ARM版HomebrewARM版Homebrew最终被安装在/opt/homebrew路径下。直接执行:/bin/bash-c"$(curl-fsSLhttps://gitee.com/ineo6/homebrew-install/raw/master/ins......
  • Mac 登录 window server 2012 软件工具
    MicrosoftRemoteDesktopBeta是微软公司的一款远程桌面应用程序,用于远程访问Windows计算机或服务器。以下是它的简短功能介绍:远程访问:MicrosoftRemoteDesktopBeta......
  • Mac 录制GIF动图工具 LICEcap
    LICEcap是一款开源的屏幕录制工具,主要用于创建GIF动画。它适用于Windows和Mac操作系统,并提供简单易用的界面。用户可以通过拖拽和调整大小的方式,选择需要录制的区域,还可以......
  • Mac 备份整个网站工具SiteSucker
    SiteSucker是一款Mac操作系统下的网站下载工具,主要用于将整个网站离线下载到本地电脑上,以便离线查看或备份。下面是SiteSucker的一些中文功能介绍:下载网站:SiteSucker能......
  • Mac 系统烧录工具
    balenaEtcher是一款跨平台的开源烧录工具,主要用于制作启动盘和镜像文件。下面是balenaEtcher的一些中文功能介绍:制作启动盘:balenaEtcher能够将ISO、IMG和ZIP文件等镜像......
  • Java基础知识点(数组遍历以及常见问题)
    一:数组遍历:将数组中的所有内容取出来,取出来之后可以对它进行一系列的操作。注意:遍历指的是取出数据的过程,不要局限的理解为遍历就是打印。在Java中,关于数组的一个长度属性.l......