Why do we use Homebrew on Ubuntu Linux?

Are you an Ubuntu user looking for a more efficient and fast package management solution apart from the default APT? If so, installing a Homebrew setup on your Linux machine is the way to go. Homebrew is a powerful package manager for Ubuntu and other Linux systems that simplifies the process of package management – from their installation to their removal and upgrades.

Advantages of using Homebrew on Ubuntu:

Note: We recommend sticking with the default package manager for the common package installations. However, if some packages can only be installed using Brew then go for it.

1. Ease of Use

The first reason why should we use Homebrew (a.k.a LinuxBrew) in Ubuntu is that it provides great performance, speed, and ease of usage compared to other popular package managers. If you are switching from macOS, then you will have a familiar command line to install and uninstall the packages.

Furthermore, its quick installation process and minimal disk usage make it one of the best available solutions when it comes to dealing with big projects or apps.

Through its simple syntax, scripting skills are no longer needed to use or manage packages with Homebrew – making it beginner-friendly as well.

 

2. Package Availability in HomeBrew

Unlike some other package managers, using Homebrew extends beyond Ubuntu’s stock applications range. With over 200K packages available from the official repository, you can find almost all the latest and popular Linux software packages without any additional configuration.

However, many packages are natively not present to install via your Linux default repo but that doesn’t mean they are out of reach – if there is a program not supported by Ubuntu repositories, chances are high that you’ll be able to find it in the huge collection at Homebrew instead. Furthermore, software like NodeJS can also be found in Homebrew’s vast repository so continuing your project work isn’t nearly as time-consuming anymore!

 

3. Quick Updates & Security Fixes

If security issues arise due to bugs present in main packages (developed mainly by Canonical) or you want the latest version of some package that is not available via the official repo then just updating those specific components becomes necessary quickly – something which can be done easily through Homebrew with just a few commands.

Through homebrew one can quickly access newly released updates on a rolling basis thereby making sure the system stays secure against any potential risk.

 

4. Brew doesn’t need root or sudo access to install software

Whether it is Yum, APT, or other popular Linux package managers, to install some software or package we need at least sudo access. It is because they are specially designed to work at the OS level so that we can upgrade our system when necessary including the installation of various packages. But what if you don’t want to give some users sudo permission but still have access to install essential packages? Try out Brew in that case.

Homebrew doesn’t need to root or sudo access to install software packages. In fact, it is designed to create and maintain a separate user owned-directory to install packages, which doesn’t need Admin user permission.

 

5. Multiple Versions of Linux Packages

APT or Yum kind of Linux package managers are designed to install the latest version packages by overwriting the older ones, this is not the case with Brew.

Homebrew package manager allows you immense freedom when it comes to versions because it compiles them into version-specific subdirectories, hence you will have multiple versions of packages on your Ubuntu. However, only one of them which is symlinked can be used globally. So, a user can switch between the versions of packages as required.

 

6. Cross-platform support -macOS and Linux

We don’t need to make ourselves familiar with different package managers because we can use the Brew on macOS and Linux. Even Windows Subsystem Linux users can use it to install packages.

 

Installing Homebrew on Linux

Install Development tools:

For Debian and Ubuntu including the Linux based on them, run:

sudo apt-get install build-essential procps curl file git

For Fedora, CentOS, Red Hat, Almalinux, Rocky Linux, or Oracle Linux:

sudo yum groupinstall 'Development Tools'
sudo yum install procps-ng curl file git libxcrypt-compat

Common Script to install LinuxBrew:

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

Add it to the system’s path:

echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> $HOME/.bashrc

 

How to manage packages using HomeBrew

Install packages using the brew command:

brew install package-name

For example: to install wget we can use:

brew install wget

To uninstall brew packages:

If you want to remove some packages installed using the Homebrew command line tool then for that use the following syntax:

brew uninstall package-name

For Example:

brew uninstall wget

To remove the dependencies which are on your system but not required by any installed application, use:

brew autoremove

Command to upgrade existing Brew installed packages:

For some particular Brew installed package, let’s say wget.

brew upgrade wget

Whereas to upgrade all Homebrew installed packages use:

brew upgrade

 

How to remove Homebrew from Linux

Well, if you are not satisfied with this package manager and want to uninstall Homebrew from Ubuntu, CentOS, Debian, or any other Linux then use:

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

Type Y  and hit the Enter key when the system asks for your confirmation.

Also, remove the directory containing its files:

sudo rm -r /home/linuxbrew/

 

Other Articles:

 

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.