How to use the Homebrew install the software on Linux and Windows

For a long time, Homebrew software has been a convenient tool for Mac users, but only for Mac users. The application adds Linux style package manager, so that users can easily install command-line utility. Now, 2.0.0 and later, the Mac application is no longer proprietary.

With Windows subsystem for Linux, Homebrew is now available for Linux and Windows users. However, there is one major difference: the name. On Linux systems, the application is called Linuxbrew.

How to use the Homebrew install the software on Linux and Windows

Why replace the distribution's package manager with Homebrew?

For some reason you may choose to use the standard package manager Linuxbrew rather than the system. First, you do not need to use the sudo command to install package. You do not even need root privileges to install it. Packages installed in your home directory or specific Linuxbrew home directory.

System Requirements

In Linuxbrew part Homebrew site that lists some of the system requirements, most of the relatively new system can easily meet the following requirements:

  • GCC 4.4 or later.
  • Linux 2.6.32 or later.
  • Glibc 2.12 or later.
  • 64 x86_64 CPU.

Related Links

Homebrew website

Currently it does not support 32-bit systems, so if you are running an older system, you may be unlucky. Also you need to install some dependencies.

Installation Linuxbrew dependencies

For Ubuntu or other Debian-based systems, you can install the Homebrew need to run all the content in one command:

How to use the Homebrew install the software on Linux and Windows

Testing of Ubuntu 18.04.3 LTS dependencies are installed

sudo yum groupinstall ‘Development Tools’ && sudo yum install curl file git

Installation Linuxbrew

And dependencies, like, you can use a single command to install Linuxbrew. This will Linuxbrew GitHub repository to download and run the installer script:

How to use the Homebrew install the software on Linux and Windows

test -d \~/.linuxbrew && eval $(\~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r \~/.bash\_profile && echo "eval \\$($(brew --prefix)/bin/brew shellenv)" >>\~/.bash\_profile
echo "eval \\$($(brew --prefix)/bin/brew shellenv)" >>\~/.profile

How to use the Homebrew install the software on Linux and Windows

If you log off and return to the selected shell command above does not work, the "~ / .bashrc," "~ / .zshrc" or other related shell configuration, add the following line:

export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH

Now, you can try using Linuxbrew installation packages. The installer is recommended to install gcc, so first:

brew install gcc

brew install hello

How to use the Homebrew install the software on Linux and Windows

Use Linuxbrew

As shown above, the simplest command brew install, followed by the name of the package you want to install. To search for available packages, Homebrew this package called "formulae", you can brew search, followed by name. For more information about a specific recipe to be displayed, use Brew information and its name. Finally, brew update will update Linuxbrew and formulae installed.

How to use the Homebrew install the software on Linux and Windows

How to use the Homebrew install the software on Linux and Windows

If you do not install your Linuxbrew working properly, or you are unsure, a command is brew doctor (see above). If all goes well, this command will report "Your system is ready." If a problem, this command will tell you where to start to fix the problem. For more command, see the Homebrew program documentation, but more should be the main content you need to know.

This article helpful?

Guess you like

Origin www.linuxidc.com/Linux/2019-12/161635.htm