Let’s go through the steps to install Homebrew (Linux brew) on Ubuntu 22.04 LTS Jammy JellyFish to install packages available through its library.
Open source Homebrew (package manager) is meant to install various packages easily on macOS as well as Linux. Although the Linux package manager offers a wide range of applications to install, however, still if you are an existing user of macOS and now switching to Linux – Homebrew can be an option to get a familiar command line to install packages. Homebrew in Linux is called “Linuxbrew”.
Steps to install HomeBrew on Ubuntu 22.04 Linux
The instructions are given here to set up Homebrew will be the same for other Ubuntu versions including Debian, Linux Mint, MX Linux, POP OS…
1. Run system update
First, run the system update command to achieve the latest state of system packages. Well, this is not a necessary step however as here we will use APT package manager, hence a good practice before installing any software.
sudo apt update
2. Get Git and Developer tools
To set up and use brew, we need to have developers’ tools on our Ubuntu system. And all the required ones can be installed using the “build-essential” packages.
sudo apt install build-essential git
3. Install Brew on Ubuntu 22.04 Linux
To make things easy and simpler for any new or old Linux user, the developers of HomeBrew offer a script to automate the installation process. It is available on the official GitHub page of Brew.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Follow the instructions given by the script to install and set up Homebrew on Ubuntu 22.04 Linux.
4. Add Homebrew to your PATH
To run the brew commands regardless of the directory in which we are, add the folder where Homebrew has been installed, in your system’s environment path…
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/h2s/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
5. Confirm Linux Brew is working fine
Well, now you will already have the Brew on your Ubuntu 22.04 Linux to install the packages available via its library. However, to confirm it is working fine, we can run the given command:
6. Install some package
You can check the options available for Linux brew using the command –
And if you want to install some package using it, then the command line is simple like APT. Here are some examples:
Let’s say you want to install some software such as a
tree. It offers an informative representation of directories and their files.
To install any package, the syntax will be:
brew install package-name
brew install tree
In the same way to upgrade and uninstall any package:
brew upgrade tree
brew uninstall tree
7. How to update/upgrade
In case, you want to update your installed brew version, then here is the command:
8. Brew Uninstallation- Ubuntu 22.04
For those who are not interested in the Brew anymore on their Linux, they can remove it as well. Developers of this open-source package manager also offer a script to completely delete it.
Download the script:
curl -fsSL -o uninstall.sh https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh
Check out the options available
bash uninstall.sh --help
To finally remove it:
• 2 Ways to Install Homebrew on Debian 11 Bullseye Linux
• Upgrade Ubuntu 20.04 To 22.04 LTS Jammy using Command
• Install Zoom Client on Ubuntu 22.04 Jammy
2 thoughts on “Install Brew on Ubuntu 22.04 LTS Jammy Linux”
(echo; echo ‘eval “$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)”‘) >> /home/h2s/.bashrc
Replace h2s with your USER name or $USER