如何在 Mac OS X 上安装 apt-get 或 YUM

如何在 Mac OS X 上安装 apt-get 或 YUM

我想使用 或apt-get之一yum

如何安装并使其成功运行?

答案1

如果您想要 Mac OS X 上的 apt-get 或 yum 等价物,您有两种选择。

  1. 自制:http://brew.sh
  2. Mac端口:http://www.macports.org

您可以使用brew install PACKAGE_NAMEport install PACKAGE_NAME安装可用的软件包。

答案2

您需要安装 Homebrew 或 YUM。要安装 Homebrew,请在终端中输入以下命令。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

然后使用brew安装包裹名字

答案3

可以使用名为 Fink 的第三方软件在 OS X 10.9(如基于 Deb 的 Linux)上使用 apt-get -如何在 Mac OS X 上安装 apt-get。然而,与 Homebrew 和 OS X 包管理器不同,Fink 不使用 /usr/local/ 路径来安装软件。它只是意味着,Fink 适合稍微高级的用户,他们可以处理软件冲突(版本差异)。 Homebrew,对我来说是最好的包管理器......

答案4

这些是其他一些方式

访问https://sdkman.io/

# you can use sdk install command to install software
$ sdk install package_name

例子:

MacdeMacBook-Pro$ sdk install java 8.0.191-oracle

Oracle requires that you agree with the Oracle Binary Code License Agreement
prior to installation. The license agreement can be found at:

http://www.oracle.com/technetwork/java/javase/terms/license/index.html

Do you agree to the terms of this agreement? (Y/n): Y

Downloading: java 8.0.191-oracle

In progress...
########################## 100.0%
We will be needing super powers...
Password:

Repackaging Java 8u191...
Attaching to the DMG...
Mounting DMG as Volume...
Volume(s) mounted successfully
Installing PKG inside DMG...
installer: Package name is JDK 8 Update 191
installer: Installing at base path /
installer: The install was successful.
Copy JDK Home to temp folder...
Preparing archive...
Unmounting volume...
"/Volumes/JDK 8 Update 191" unmounted successfully.
Done repackaging...
Cleaning up cookie...

Installing: java 8.0.191-oracle
Done installing!

Setting java 8.0.191-oracle as default.
MacdeMacBook-Pro:Homebrew mac$ java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

相关内容