How to install Homebrew on Ubuntu 20.04 / 18.04 / Debian 10?

Windows Articles

How to backup and restore Group Policy Objects in Windows Server 2016/2019.

Hi! Previously we have mentioned that Windows Server pursues a centralized administration of each role and service. In this way, a fluid...

How to use the ls command?

The ls commands list the content and optional information of the directories and files. When you execute the Ls command without options,...

How to Install APK file on Android

Hello Friends! Today we bring you a simple guide on how to install an APK file in Android. What...

How to Install the Latest version of FFmpeg on Ubuntu 20.04 / Debian 10?

Knowing how to install the latest version of FFmpeg is important if you know how to work with multimedia files. So in...

How to block emails from specific senders in Outlook

Hello, how are you? Today we will talk a little about Microsoft Outlook. It is well known that its main function is...
angeloma
angeloma
Senior Writer and partner

Installing applications on Linux is quite easy. However, other tools help even more with the process. So, today in this post, I’ll show you how to install Homebrew on Ubuntu 20.04 / 18.04 / Debian 10

APT is the package manager for Debian and Ubuntu. It’s one of the oldest ones and serves to install and uninstall packages from the repositories added to the system. Of course, it’s not the only thing it’s good for, but it’s the most basic. However, there is another one that can help complement it.

Homebrew is a CLI package manager that performs the same operations but not from the system repositories. This further expands the amount of programs and packages available. An example of this is that through Homebrew we can have the latest stable version of wget.

The project was initially intended for macOS as a complement to the official application store. This allows us to install other applications by just executing a command. Something that many users of this system appreciate. However, it also has a version for Linux easy to install and use.

Homebrew installs the programs in /usr/local and then makes a symbolic link to the binary folder. This means that it does not require sudo and does not affect the system.

So let’s go for it.

Install Homebrew on Ubuntu 20.04 / 18.04 / Debian 10

It is quite simple to install Homebrew on both Debian and Ubuntu. And there are even several methods. However, the one that the project website recommends is the one that downloads a script and it does everything.

Before we start, we will install some basic compilation packages:

:~$ sudo apt-get install build-essential curl file git

It’s most likely already installed, but it’s best to be sure.

Now we can start the installation:

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

The above command downloads the installation script using curl and then executes it.

At first you will see a list of changes and after pressing Enter the installation will begin.

At the end, if everything went well, you will see the following message.

1.- Install homebrew on Ubuntu / Debian
1.- Install homebrew on Ubuntu / Debian

After the installation is complete it is now time to make the program available on the system. To do this, execute these commands:

:~$ 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

Once they’ve been executed, it’s ready. We can use Homebrew now.

Testing Homebrew on Linux

To know if Homebrew is correctly installed, we can install the test package called hello.

:~$ brew install hello
Updating Homebrew...
==> Installing dependencies for hello: patchelf
==> Installing hello dependency: patchelf
==> Downloading https://linuxbrew.bintray.com/bottles/patchelf-0.10.x86_64_linux.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/98/988b224305ff3fecadf9bbf5fbe1b18061077be6c896935b2cef29298526f5b8?__gda__=exp=1585719008~hmac=b25ba43087087ab2f20d79646
######################################################################## 100.0%
==> Pouring patchelf-0.10.x86_64_linux.bottle.tar.gz
🍺 /home/linuxbrew/.linuxbrew/Cellar/patchelf/0.10: 8 files, 921.5KB
==> Installing hello
==> Downloading https://linuxbrew.bintray.com/bottles/hello-2.10.x86_64_linux.bottle.tar.gz
######################################################################## 100.0%
==> Pouring hello-2.10.x86_64_linux.bottle.tar.gz
🍺 /home/linuxbrew/.linuxbrew/Cellar/hello/2.10: 52 files, 595.6KB
1.- Install homebrew on Ubuntu / Debian
1.- Install homebrew on Ubuntu / Debian

Next, run it:

:~$ hello
Hello, world!

With Homebrew you can install many useful programs, to have a complete list run:

:~$ brew search

And you’ll see a long list.

3.- Search for programs to install using Homebrew
3.- Search for programs to install using Homebrew

Also, you can search for a specific program using a keyword.

~$ brew search --desc "keyword"

To learn more about Homebrew you can read the command help.

:~$ brew --help
Example usage:
brew search [TEXT|/REGEX/]
brew info [FORMULA...]
brew install FORMULA...
brew update
brew upgrade [FORMULA...]
brew uninstall FORMULA...
brew list [FORMULA...]

Troubleshooting:
brew config
brew doctor
brew install --verbose --debug FORMULA

Contributing:
brew create [URL [--no-fetch]]
brew edit [FORMULA...]

Further help:
brew commands
brew help [COMMAND]
man brew
https://docs.brew.sh

Finally, you can check the installed version.

:~$ brew --version
Homebrew 2.3.0
Homebrew/linuxbrew-core (git revision 803888; last commit 2020-06-05)
4.- Homebrew on Ubuntu / Debian
4.- Homebrew on Ubuntu / Debian

So, enjoy it.

Conclusion

Homebrew is a tool that makes it even easier to install applications on Linux. It is not intended to replace the traditional package managers, but rather works as a complement to them.

Please share this tool and join our Telegram channel.

More articles

3 COMMENTS

  1. Thanks this was very helpful.
    There is a typo in the section on making the program available to the system
    This section of the 3 line of code
    && echo “eval” ($(brew –prefi
    should look like this
    && echo eval “($(brew –prefi
    It throws an error until correcting.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to backup and restore Group Policy Objects in Windows Server 2016/2019.

Hi! Previously we have mentioned that Windows Server pursues a centralized administration of each role and service. In this way, a fluid...

How to use the ls command?

The ls commands list the content and optional information of the directories and files. When you execute the Ls command without options,...

How to Install APK file on Android

Hello Friends! Today we bring you a simple guide on how to install an APK file in Android. What...

How to Install the Latest version of FFmpeg on Ubuntu 20.04 / Debian 10?

Knowing how to install the latest version of FFmpeg is important if you know how to work with multimedia files. So in...

How to block emails from specific senders in Outlook

Hello, how are you? Today we will talk a little about Microsoft Outlook. It is well known that its main function is...
x