簡體   English   中英

通過自制軟件安裝特定版本的 R

[英]Install specific version of R via homebrew

我已經在 macOS 中從 Home-brew 安裝了 R:

brew install R

不過,現在我需要切換版本並安裝特定的 R 版本。 出於這個原因,我嘗試以兩種方式安裝 R-3.5.2,但均未成功:

brew install R-3.5.2
brew install R@3.5.2

這就是我得到的:

Error: No available formula with the name "r@3.5.2" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

你有什么主意嗎? 謝謝: )

免責聲明:我沒有可用於測試的 Mac。

在這里你可以找到一個關於如何通過自制軟件安裝舊版本的非常有用的教程, 這里是另一個。

對於 R 這轉換為:

git clone https://github.com/Homebrew/homebrew-core.git
cd homebrew-core/
git log master -- Formula/r.rb

這為 R 3.5.2 產生以下提交:

commit e66b3a288ee5e68c3c04e95705b7311c9f76bdf2
Author: ...
Date:   Sun Jan 13 10:59:16 2019 +0000

    r: update 3.5.2_2 bottle.

commit a2ced14fabb30732b2b6f22919105ac66085e78c
Author: ...
Date:   Tue Jan 8 10:36:41 2019 +0100

    r: revision for readline

commit 61c60b0c4c237a0ada3ab8b83b934566b101ee67
Author: ...
Date:   Sat Jan 5 04:06:37 2019 +0000

    r: update 3.5.2_1 bottle.

commit f9325e5e63ba812d1a2d5fd405811e313f782ff1
Author: ...
Date:   Fri Jan 4 17:36:34 2019 +0100

    r: build with openblas

commit 70aca0ac8f83459ff1ce18c1ea3f462b49434eb2
Author: ...
Date:   Fri Dec 21 06:48:02 2018 +0000

    r: update 3.5.2 bottle.

commit d344d5b57d0c8b0bf0ef6b3052e6bed551b37b47
Author: ...
Date:   Fri Dec 21 14:31:14 2018 +0800

    r 3.5.2

    Closes #35321.

作為替代方案,您可以通過 URL 搜索提交(請參閱評論):

https://github.com/Homebrew/homebrew-core/search?q=r%203.5.2&type=commits


因此,您應該能夠通過(最新的 R 3.5.2 提交)安裝 R 3.5.2:

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/e66b3a288ee5e68c3c04e95705b7311c9f76bdf2/Formula/r.rb

或者:

brew install https://github.com/Homebrew/homebrew-core/raw/e66b3a2/Formula/r.rb

本文中提到的brew switchbrew pin可能也很有趣。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM