Homebrew:Mac OS 使用brew工具時報錯No remote ‘origin’

使用 brew update 時報錯:

情況是有一天要下載brew包挟裂,發(fā)現(xiàn)update時報錯如下。

brew update
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-cask, skipping update!
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-core, skipping update!
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
Already up-to-date.

解決辦法:

1. 執(zhí)行doctor檢查程序

brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Suspicious https://github.com/Homebrew/brew git origin remote found.
The current git origin is:
  https://mirrors.ustc.edu.cn/brew.git

With a non-standard origin, Homebrew won't update properly.
You can solve this by setting the origin remote:
  git -C "/opt/homebrew" remote set-url origin https://github.com/Homebrew/brew

Warning: Homebrew/homebrew-cask was not tapped properly! Run:
  rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-cask"
  brew tap homebrew/cask

Warning: Homebrew/homebrew-core was not tapped properly! Run:
  rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
  brew tap homebrew/core

2. 然后按照doctor的指示進(jìn)行操作

git -C "/opt/homebrew" remote set-url origin https://github.com/Homebrew/brew
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-cask"
brew tap homebrew/cask
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-core, skipping update!
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
Running `brew update --preinstall`...
==> Tapping homebrew/cask
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 641773, done.
remote: Counting objects: 100% (157/157), done.
remote: Compressing objects: 100% (89/89), done.
remote: Total 641773 (delta 73), reused 145 (delta 68), pack-reused 641616
Receiving objects: 100% (641773/641773), 303.13 MiB | 370.00 KiB/s, done.
Resolving deltas: 100% (454361/454361), done.
Tapped 4016 casks (4,088 files, 323.7MB).
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
==> Tapping homebrew/core
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Enumerating objects: 1198940, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 1198940 (delta 4), reused 9 (delta 4), pack-reused 1198930
Receiving objects: 100% (1198940/1198940), 484.85 MiB | 1.03 MiB/s, done.
Resolving deltas: 100% (825674/825674), done.
Tapped 3 commands and 6093 formulae (6,433 files, 531.5MB).

3. 再次進(jìn)行brew update

brew update
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
Error: Fetching /opt/homebrew failed!
Updated 2 taps (homebrew/core and homebrew/cask).

雖然能進(jìn)行update了蛋铆,但是還是有一個remote倉庫連不上滨溉。于是需要將homebrew-services也進(jìn)行重裝.

rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-services"
brew tap homebrew/services
==> Tapping homebrew/services
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 2000, done.
remote: Counting objects: 100% (509/509), done.
remote: Compressing objects: 100% (176/176), done.
remote: Total 2000 (delta 348), reused 441 (delta 325), pack-reused 1491
Receiving objects: 100% (2000/2000), 548.53 KiB | 1.02 MiB/s, done.
Resolving deltas: 100% (903/903), done.
Tapped 1 command (45 files, 700.5KB).

好了終于可以愉快的 brew update brew upgrade了。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末维咸,一起剝皮案震驚了整個濱河市渠啤,隨后出現(xiàn)的幾起案子狐肢,更是在濱河造成了極大的恐慌,老刑警劉巖埃篓,帶你破解...
    沈念sama閱讀 216,470評論 6 501
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件处坪,死亡現(xiàn)場離奇詭異,居然都是意外死亡架专,警方通過查閱死者的電腦和手機(jī)同窘,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,393評論 3 392
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來部脚,“玉大人想邦,你說我怎么就攤上這事∥酰” “怎么了丧没?”我有些...
    開封第一講書人閱讀 162,577評論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長锡移。 經(jīng)常有香客問我呕童,道長,這世上最難降的妖魔是什么淆珊? 我笑而不...
    開封第一講書人閱讀 58,176評論 1 292
  • 正文 為了忘掉前任夺饲,我火速辦了婚禮,結(jié)果婚禮上施符,老公的妹妹穿的比我還像新娘往声。我一直安慰自己,他們只是感情好戳吝,可當(dāng)我...
    茶點故事閱讀 67,189評論 6 388
  • 文/花漫 我一把揭開白布浩销。 她就那樣靜靜地躺著,像睡著了一般听哭。 火紅的嫁衣襯著肌膚如雪慢洋。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,155評論 1 299
  • 那天欢唾,我揣著相機(jī)與錄音且警,去河邊找鬼。 笑死礁遣,一個胖子當(dāng)著我的面吹牛斑芜,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播祟霍,決...
    沈念sama閱讀 40,041評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼杏头,長吁一口氣:“原來是場噩夢啊……” “哼盈包!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起醇王,我...
    開封第一講書人閱讀 38,903評論 0 274
  • 序言:老撾萬榮一對情侶失蹤呢燥,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后寓娩,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體叛氨,經(jīng)...
    沈念sama閱讀 45,319評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,539評論 2 332
  • 正文 我和宋清朗相戀三年棘伴,在試婚紗的時候發(fā)現(xiàn)自己被綠了寞埠。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 39,703評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡焊夸,死狀恐怖仁连,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情阱穗,我是刑警寧澤饭冬,帶...
    沈念sama閱讀 35,417評論 5 343
  • 正文 年R本政府宣布,位于F島的核電站揪阶,受9級特大地震影響昌抠,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜鲁僚,卻給世界環(huán)境...
    茶點故事閱讀 41,013評論 3 325
  • 文/蒙蒙 一扰魂、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧蕴茴,春花似錦、人聲如沸姐直。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,664評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽声畏。三九已至撞叽,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間插龄,已是汗流浹背愿棋。 一陣腳步聲響...
    開封第一講書人閱讀 32,818評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點兒被人妖公主榨干…… 1. 我叫王不留均牢,地道東北人糠雨。 一個月前我還...
    沈念sama閱讀 47,711評論 2 368
  • 正文 我出身青樓,卻偏偏與公主長得像徘跪,于是被迫代替她去往敵國和親甘邀。 傳聞我的和親對象是個殘疾皇子琅攘,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,601評論 2 353

推薦閱讀更多精彩內(nèi)容