Меню Рубрики

Sudo apt get mac os

How to install apt-get or YUM on Mac OS X

I want to use either of apt-get or yum .

How to install them and make them successful running?

5 Answers 5

If you want the equivalent of apt-get or yum on Mac OS X, you have two choices.

You can use brew install PACKAGE_NAME or port install PACKAGE_NAME to install the package available.

You need to install either Homebrew or YUM. I recommend using HomeBrew. To install it enter the following command in terminal.

then use brew install Package_name

It is possible to use apt-get on OS X 10.9 like Deb based Linux using a third party software named Fink – How to Install apt-get on Mac OS X. However, unlike Homebrew and OS X Package Managers, Fink does not use /usr/local/ path to install software. It simply means, Fink is for a bit advanced users who can handle the software conflicts (for difference in version). Homebrew, to me is the best package manager.

These are some other way

install pkg

$ sdk install or i [version]

uninstall pkg

$ sdk uninstall or rm

list avaliable pkg

$ sdk list or ls [candidate] # $ sdk use or u [version] $ sdk default or d [version] $ sdk current or c [candidate] $ sdk upgrade or ug [candidate]

show current version of sdk manager

$ sdk version or v $ sdk broadcast or b $ sdk help or h $ sdk offline [enable|disable] $ sdk selfupdate [force] $ sdk update $ sdk flush


Установка и работа с менеджером пакетов для Maс OS X (MacPort и Homebrew)

Менеджер пакетов в Mac OS X позволит нам легко работать с пакетам посторонних разработчиков. В этом топике рассмотрим два таких менеджера: MacPort и Homebrew.

1. MacPort

Официальний сайт
На этом же сайте можна найти Mac OS X Package (.pkg) Installer для Mountain Lion, Lion, Snow Leopard и Leopard. Установите подходящий вам пакет и пользуйтесь на здоровье. Есть и другие способы установки, но мы выбрали простой и быстрый. На случей чево, у меня port установился сюда: /opt/local/bin/port.


Работать с port придельно просто — ищем в «портах» нужный пакет и устанавливаем его:

Дополнительные команды:

2. Homebrew

Официальная страница
О Homebrew поговорим подробнее…


После успешной установки виполним следующую команду:

Если в результате этой команди получим ответ: «Your system is raring to brew», тогода все хорошо и можете спокойно начинать работу з brew. В ином случае продолжим…

Если возникла ошибка Warning: Experimental support for using Xcode without the «Command Line Tools», то скорее всего была обновлена «ось», к примеру, с Lion к Mountain Lion, но не была переустановлена Command Line Tools для Xcode.

Если возникла ошибка Error: No such file or directory — /usr/local/Cellar, то нужна создать эту директорию:

После этого опять запускаем команду:

Если мы получим что-то вроде этого:

то исправляем примером так:

Если на этот раз никаких ошибок не произошло, тогда все — можна спокойно работать с Homebrew.


Как установить apt-get или YUM на Mac OS X

Я хочу использовать либо из, apt-get либо yum .

Как их установить и сделать их успешными?

Если вам нужен эквивалент apt-get или yum в Mac OS X, у вас есть два варианта.

Вы можете использовать brew install PACKAGE_NAME или port install PACKAGE_NAME для установки пакета.

Вам нужно установить либо Homebrew, либо YUM. Я рекомендую использовать HomeBrew. Для его установки введите следующую команду в терминале.

затем используйте brew install Package_name

Можно использовать APT-получить на OS X 10.9 как Deb на основе Linux с помощью стороннего программного обеспечения под названием Финка – Как установить APT-получить на Mac OS X . Однако, в отличие от Homebrew и OS X Package Manager, Fink не использует / usr / local / path для установки программного обеспечения. Это просто означает, что Fink для немного продвинутых пользователей, которые могут справиться с конфликтами программного обеспечения (для различия в версии). Доморощенный, для меня это лучший менеджер пакетов .


sudo: apt-get: command not found on Mac OS X when install? #493


Copy link Quote reply

tianqig commented Jun 18, 2017

Hi I am following the instruction from https://tensorflow.github.io/serving/setup
to install TensorFlow Serving dependencies on my Mac OS X
with the following command:
$ sudo apt-get update && sudo apt-get install -y \

Got the following error message:
sudo: apt-get: command not found

Can use brew to do the above instead of apt-get? Or it’s better to download apt-get for my Mac, then use it to do the installation?

Copy link Quote reply

mountaintom commented Jun 19, 2017

The install instructions are specific to Linux. Mac is not supported. Some adventurous people have installed TensorFlow Serving on their Macs. Homebrew https://brew.sh is what most seem to prefer to install packages on the Mac. It is the package manager that I feel most comfortable to not mess my Mac up.

At least in my case I use Docker for Mac for some development, but do most development running Linux (Mostly Ubuntu) with VirtualBox on my Mac. I keep several disposable VMs for various projects. I like the idea of not polluting my Mac OS with too much development cruft.

Copy link Quote reply

kirilg commented Jun 20, 2017

Copy link Quote reply

tianqig commented Jun 21, 2017

thanks @mountaintom for sharing

Copy link Quote reply

xhanchoLee commented Sep 3, 2017

First post to Github. Anyways, I’ve been getting sudo: apt-get: command not found .
I’m running Yosemite 10.10.5 and have tried to download various Frameworks for python using sudo through my terminal as well as trying to download IDEs.. I keep getting sudo: apt-get: command not found .
Any idea what could be causing this??

Copy link Quote reply

mountaintom commented Sep 4, 2017

apt-get is intended for installing packages on Linux systems. Homebrew is the equivalent for the Mac. It looks like Mac installs are still not officially supported; but some people have been successful in installing on their Macs. I checked to see what I could find regarding Mac installs, and it looks like people are using the Bazel source install. To install the prerequisite they are using Homebrew. Additionally, you will need to install Xcode. The following issue pops up repeatedly #389 , however the issue may have been resolved.

It would be nice if someone who has done a Mac install would share how they did it, and if there is a better/easier way than what I’m describing here.

Copy link Quote reply

regrob2 commented Nov 1, 2017

To get apt-get on the mac, You’ll want the Fink package.

What I don’t know is what are the distinctions/differences between Fink (apt-get), MacPorts (port), and Homebrew, these days.

Copy link Quote reply

yuelxx commented Jan 11, 2018

It seems like Fink is needed when getting apt-get on Mac,
to do that, you may need to download Xquartz and fink
But sadly, I failed and got the ERROR: Can’t create symlink /sw2/fink/10.13 from terminal
and couldn’t find a way to solve that 🙁 I am wondering if anyone knows.

Copy link Quote reply

anandumdas commented Mar 8, 2018

The error happens because the binary you are trying to call from command line is only part of the current user’s PATH variable, but not a part of root user’s PATH.

You can verify this by locating the path of the binary you are trying to access. In my case I was trying to call “bettercap-ng”. So I ran,

I checked whether this location is part of my root user’s PATH.

$ sudo env | grep ^PATH

So sudo cannot find the binary that I am trying to call from commandline. Hence returns the error command not found.

You can direct sudo to use the current user’s PATH when calling a binary like below.

$ sudo -E env “PATH=$PATH” [command] [arguments]

In fact, one can make an alias out of it:

$ alias mysudo=’sudo -E env “PATH=$PATH”‘

It’s also possible to name the alias itself sudo, replacing the original sudo.

Please refer to this video for step by step solution


Why is the apt-get function not working in the terminal on 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:

When I do this, it outputs:

I have no idea why this is the case.

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

5 Answers 5

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

This command would be:

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

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

Type the following in your Mac OS X terminal:

After that, usage of Homebrew is brew install

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


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.

Alpine based systems use apk .


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

Setting an environment variable:

  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 )
Close the file, and either restart the terminal or source

Running the following command:

the analytics status can then be checked with the command: