No need for Homebrew on Linux

With Linux you don’t really need to make use of the HomeBew ecosystem to install Raylib.
The instructions on Working on GNU Linux · raysan5/raylib Wiki · GitHub actually are not as complicated as they appear to be on first glance.

Save this as Install_Raylib_on_Ubuntu.sh

#!/bin/bash

echo "This script will install all system-packages required to fetch and build"
echo "Raylib, and then install it in /usr/local and make it known to the system"
echo "as a library to use in C++ projects."
echo
read -p "Press enter to install Raylib or Ctrl-C to cancel"

sudo apt install build-essential git
sudo apt install cmake
sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev

cd $HOME
mkdir github && cd github

git clone https://github.com/raysan5/raylib.git raylib
cd raylib
mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=ON ..
make
sudo make install
sudo ldconfig

Then just run it like this: bash Install_Raylib_on_Ubuntu.sh
It will install all pre-requisites, then create a folder github in your HOME folder, then grab Raylib directly from github, then install Raylib into your system into /usr/local (which is a common place for things installed system-wide that aren’t installed as packages).

If you’re on another Distro, just follow the instructions on the Raylib page for installing the packages, remove all lines inthe script that start with sudo apt, then install Raylib just the same.

1 Like

Privacy & Terms