为什么apt-get功能在Mac OS X v10.9(Mavericks)的终端上不起作用? [英] Why is the apt-get function not working in the terminal on Mac OS X v10.9 (Mavericks)?

查看:101
本文介绍了为什么apt-get功能在Mac OS X v10.9(Mavericks)的终端上不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在观看,并且,如您所见,第一个命令我被告知要输入的是:

I was watching this, and, as you can see, the first command I am told to put in is:

sudo apt-get install python-setuptools

当我这样做时,它输出:

When I do this, it outputs:

sudo: apt-get: command not found

我不知道为什么会这样.

I have no idea why this is the case.

如何解决此问题,以便正确地遵循本教程?

How can I resolve this so I am following the tutorial correctly?

推荐答案

Mac OS X没有apt-get.有一个名为 Homebrew 的程序包管理器.

Mac OS X doesn't have apt-get. There is a package manager called Homebrew that is used instead.

该命令为:

简单安装python

brew install python

使用Homebrew安装否则将使用apt-get的软件包.

Use Homebrew to install packages that you would otherwise use apt-get for.

我链接到的页面具有最新的安装Homebrew的方式,但是目前,您可以按以下方式安装Homebrew:

The page I linked to has an up-to-date way of installing homebrew, but at present, you can install Homebrew as follows:

在Mac OS X终端中键入以下内容:

Type the following in your Mac OS X terminal:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

之后,Homebrew的使用方式为brew install <package>.

After that, usage of Homebrew is brew install <package>.

Xcode命令行工具是Homebrew的前提条件之一.

One of the prerequisites for Homebrew are the XCode command line tools.

  1. 从App Store安装XCode.
  2. 按照此堆栈溢出答案中的说明安装XCode命令行工具.

背景

软件包管理器(如apt-getbrew)只是为您的系统提供了一种简单,自动化的安装软件包或库的方法.不同的系统使用不同的程序. apt及其派生词在基于Debian的linux系统上使用.带有Red Hat风格的Linux系统使用rpm(或者至少在很多年前,他们做了很多). yum还是基于RedHat的系统的软件包管理器.

Background

A package manager (like apt-get or brew) just gives your system an easy and automated way to install packages or libraries. Different systems use different programs. apt and its derivatives are used on Debian based linux systems. Red Hat-ish Linux systems use rpm (or at least they did many, many, years ago). yum is also a package manager for RedHat based systems.

基于阿尔卑斯的系统使用apk.

Alpine based systems use apk.

截至2016年4月25日,首页酿造默认情况下使用户选择发送分析 .可以通过两种方式选择退出:

As of 25 April 2016, homebrew opts the user in to sending analytics by default. This can be opted out of in two ways:

设置环境变量:

  1. 打开您的
  1. Open your favorite environment variable editor.
  2. Set the following: HOMEBREW_NO_ANALYTICS=1 in whereever you keep your environment variables (typically something like ~/.bash_profile)
  3. Close the file, and either restart the terminal or source ~/.bash_profile.

运行以下命令:

brew analytics off

然后可以使用以下命令检查分析状态:

the analytics status can then be checked with the command:

brew analytics

这篇关于为什么apt-get功能在Mac OS X v10.9(Mavericks)的终端上不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆