Skip to content

Installing Homebrew on Ubuntu/Debian: A Step-by-Step Guide

Homebrew is a popular package manager for macOS, but did you know it can also be installed on Linux? This guide will show you how to install Homebrew on Ubuntu/Debian, allowing you to tap into Homebrew’s extensive repository of software and tools. Whether you’re a developer looking for an easy way to install software or a user interested in exploring new tools, Homebrew on Ubuntu offers a flexible solution.

In this tutorial you will learn:

  • How to install the necessary dependencies for Homebrew
  • The steps to install Homebrew itself on Ubuntu/Debian
  • How to add Homebrew to your system’s PATH
  • Methods to verify that Homebrew has been installed correctly
Installing Homebrew on Ubuntu/Debian: A Step-by-Step Guide
Installing Homebrew on Ubuntu/Debian: A Step-by-Step Guide
CategoryRequirements, Conventions or Software Version Used
SystemAn Ubuntu-based system
Softwarecurl, git, and build-essential packages
OtherInternet connection
Conventions# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Installing Homebrew on Ubuntu/Debian GNU/Linux

Before installing Homebrew, it is essential to prepare your Ubuntu/Debian system by installing some prerequisites. Follow these steps carefully to ensure a smooth installation process.

  1. Install Necessary Dependencies: Homebrew requires certain packages to be installed on your system. Run the following command to install them:$ sudo apt-get install build-essential curl gitThis step ensures that your system has the necessary tools for compiling software, handling URL transfers, and managing version control with git.
  2. Install Homebrew: With the dependencies in place, you can now install Homebrew by running the installation script. Execute the following command:$ /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”This script downloads and installs Homebrew on your Ubuntu system. Follow any on-screen instructions during the installation process.
  3. Add Homebrew to Your PATH: To use Homebrew from any terminal session, you need to add it to your system’s PATH. The installation script will suggest a command similar to the following. Replace linuxconfig with your actual username:$ (echo; echo ‘eval “$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)”‘) >> /home/linuxconfig/.bashrc $ eval “$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)”These commands update your .bashrc file to include Homebrew’s binary location in your PATH, making it accessible from any terminal session.Add Homebrew to Your PATHAdd Homebrew to Your PATH
  4. Verify Installation: Finally, confirm that Homebrew has been installed correctly by checking its version and running a diagnostic check.$ brew –version $ brew doctor[ADSLOT01]
    The brew --version command displays the installed version of Homebrew, and brew doctor checks for potential issues. If everything is set up correctly, you’re ready to use Homebrew on Ubuntu.Verify InstallationVerify Installation

Conclusion

You’ve successfully installed Homebrew on Ubuntu/Debian! With Homebrew installed, you can easily install, update, and manage software packages on your system. This guide has walked you through the installation process, from preparing your system to verifying the installation. Explore Homebrew’s extensive repository to discover the wide range of software available at your fingertips.

Leave a Reply

Your email address will not be published. Required fields are marked *