Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Homebrew on Ubuntu?

I just tried to use Homebrew and Linuxbrew to install packages on my Ubuntu Server but both failed. This is how I tried to install them:

sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)" 

I got the following warning:

Warning: /home/tong/.linuxbrew/bin is not in your PATH. 

I vi my bash.bashrc in home/etc and add this:

export PATH="$HOME/.linuxbrew/bin:$PATH" export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH" export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH" 

Then I tried brew doctor but got No command 'brew' found. How am I able to use Homebrew on Ubuntu?

like image 566
Gavin Niu Avatar asked Oct 26 '15 19:10

Gavin Niu


People also ask

Does Homebrew work in Ubuntu?

The Homebrew package manager may be used on Linux and Windows Subsystem for Linux (WSL). Homebrew was formerly referred to as Linuxbrew when running on Linux or WSL. It can be installed in your home directory, in which case it does not use sudo.

Is Homebrew available on Linux?

Homebrew is a free and open-source software package management system that simplifies software installation on macOS and Linux. It was initially created for macOS and has been recommended for its ease of use as well as its integration into the command-line interface.


1 Answers

As of February 2018, installing brew on Ubuntu (mine is 17.10) machine is as simple as:

sudo apt install linuxbrew-wrapper 

Then, on first brew execution (just type brew --help) you will be asked for two installation options:

me@computer:~/$ brew --help ==> Select the Linuxbrew installation directory - Enter your password to install to /home/linuxbrew/.linuxbrew (recommended) - Press Control-D to install to /home/me/.linuxbrew - Press Control-C to cancel installation [sudo] password for me: 

For recommended option type your password (if your current user is in sudo group), or, if you prefer installing all the dependencies in your own home folder, hit Ctrl+D. Enjoy.

like image 192
Andrejs Cainikovs Avatar answered Oct 12 '22 12:10

Andrejs Cainikovs