Here's an introduction to Homebrew, an easy but unusual package manager that works with both Linux and macOS. Credit: Quinn Dombrowski Ever heard of Homebrew? It’s a package manager with a very unusual feature. It allows ordinary users to install packages without using sudo, and it’s available for both macOS and Linux. While the tool on each of these systems is referred to as Homebrew, the Linux version installs as linuxbrew. Once installed, users can use Homebrew via the brew command to install packages very easily. Installation of Homebrew itself, however, does generally require sudo privileges and installs in /home/linuxbrew. The man page for the brew command calls it “The Missing Package Manager for macOS (or Linux)”. Advantages of Homebrew Some advantages of Homebrew: It’s pretty darn easy to use and provides an easy, flexible way to install Linux tools It installs packages without requiring sudo you can use it on macOS and Linux To get your system ready with updates and prerequisites, run these commands: $ sudo dnf update $ sudo dnf groupinstall ‘Development Tools’ && sudo dnf install curl file git $ sudo dnf install libxcrypt-compat It can take a while to complete these tasks, especially if your system hasn’t been updated recently. Next, to install Homebrew in /home/linuxbrew/.linuxbrew, run this command: $ /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)” The command will prompt you at some point to enter your password. To test it out, you can install some tools with commands like these: $ brew install fortune Updating Homebrew... ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations ==> Auto-updated Homebrew! Updated 1 tap (homebrew/core). ==> New Formulae aws-sso-util ==> Updated Formulae Updated 133 formulae. ==> Downloading https://ghcr.io/v2/linuxbrew/core/fortune/manifests/9708-4 ######################################################################## ==> Downloading https://ghcr.io/v2/linuxbrew/core/fortune/blobs/sha256:64feb5e5c695578 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:6 ######################################################################## 100.0% ==> Pouring fortune—9708.x86_64_linux.bottle.4.tar.gz 🍺 /home/linuxbrew/.linuxbrew/Cellar/fortune/9708: 82 files, 2.4MB (Notice the cute little mug of brew at the bottom left.) Trying out your installed app might look like this: $ fortune Space is to place as eternity is to time. —Joseph Joubert $ which fortune /home/linuxbrew/.linuxbrew/bin/fortune In the command show below, a second package is installed: $ brew install hello ==> Downloading https://ghcr.io/v2/linuxbrew/core/hello/manifests/2.10 ######################################################################## 100.0% ==> Downloading https://ghcr.io/v2/linuxbrew/core/hello/blobs/sha256:f81d7c0a3eee9fd62 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:f ######################################################################## 100.0% ==> Pouring hello—2.10.x86_64_linux.bottle.tar.gz 🍺 /home/linuxbrew/.linuxbrew/Cellar/hello/2.10: 52 files, 595.7KB Your linuxbrew directories will look something like what you see below. $ ls -ld /home/linuxbrew drwxr-xr-x. 3 root root 4096 Sep 30 14:51 /home/linuxbrew $ ls -a /home/linuxbrew . .. .linuxbrew $ ls -l /home/linuxbrew/.linuxbrew total 48 drwxrwxr-x. 2 shs shs 4096 Oct 6 16:17 bin drwxrwxr-x. 2 shs shs 4096 Oct 4 15:30 Caskroom drwxrwxr-x. 3 shs shs 4096 Oct 6 16:17 Cellar drwxrwxr-x. 3 shs shs 4096 Oct 4 13:17 etc drwxrwxr-x. 2 shs shs 4096 Oct 4 12:54 Frameworks drwxr-xr-x. 11 shs shs 4096 Oct 4 15:45 Homebrew drwxrwxr-x. 2 shs shs 4096 Oct 4 13:17 include drwxrwxr-x. 2 shs shs 4096 Oct 4 13:17 lib drwxrwxr-x. 2 shs shs 4096 Oct 6 16:17 opt drwxrwxr-x. 2 shs shs 4096 Oct 4 13:17 sbin drwxrwxr-x. 6 shs shs 4096 Oct 6 16:17 share drwxrwxr-x. 3 shs shs 4096 Oct 4 15:30 var To display the packages installed with the brew command, do this: $ brew list ==> Formulae fortune hello In the output shown above, Formulae is the package browser. The second line lists the installed packages. To remove a package installed by Homebrew, use either the brew uninstall or the brew remove command. They both do the same thing—uninstall the specified package. $ brew remove hello Uninstalling /home/linuxbrew/.linuxbrew/Cellar/hello/2.10... (52 files, 595.7KB) Verifying the removal would look like this: $ brew list ==> Formulae Fortune Homebrew does not make use of any libraries provided by your host system, except glibc and gcc if they are new enough. In addition, Homebrew can install its own current versions of glibc and gcc for older distributions of Linux. Homebrew acts like a command-line package installer. It’s safe as long as you understand what you are downloading. It uses SHA256 as its package verification check. Linuxbrew requirements Current requirements for Linuxbrew include: GCC 4.7.0 or newer Linux 2.6.32 or newer Glibc 2.13 or newer 64-bit x86_64 CPU Related content how-to How to find files on Linux There are many options you can use to find files on Linux, including searching by file name (or partial name), age, owner, group, size, type and inode number. By Sandra Henry Stocker Jun 24, 2024 8 mins Linux opinion Linux in your car: Red Hat’s milestone collaboration with exida With contributions from Red Hat and critical collaborators, the safety and security of automotive vehicles has reached a new level of reliability. By Sandra Henry Stocker Jun 17, 2024 5 mins Linux how-to How to print from the Linux command line: double-sided, landscape and more There's a lot more to printing from the Linux command line than the lp command. Check out some of the many available options. By Sandra Henry Stocker Jun 11, 2024 6 mins Linux how-to Converting between uppercase and lowercase on the Linux command line Converting text between uppercase and lowercase can be very tedious, especially when you want to avoid inadvertent misspellings. Fortunately, Linux provides a handful of commands that can make the job very easy. By Sandra Henry Stocker Jun 07, 2024 5 mins Linux PODCASTS VIDEOS RESOURCES EVENTS NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe