ROS2 + Gazebo install
Prereqs
- Windows with WSL+Ubuntu 24.04 installed (see this guide on how to install WSL)
OR - Ubuntu 24.04 running natively via Dualboot or USB
Installing ROS2 + Gazebo
Automated via script
- Open your Linux terminal
- If you're running WSL, open it by pressing Win+R then
WSLinto the run window- Ensure you're on Ubuntu 24.04 by running
lsb_release -ain the Linux terminal 
- If not, open
TerminalorCommand Promptin Windows and typewsl -d Ubuntu-24.04to ensure your booting into the correct Ubuntu version. If this doesn't work, ensure your installation is correct.
- Ensure you're on Ubuntu 24.04 by running
- If you're running Ubuntu dualbooted/on USB, just search for terminal or press
CTRL+Alt+T
- Ensure you're in home
cd ~
- Update system packages
sudo apt update && sudo apt upgrade
- Download ROS2+Gazebo install script (reminder that pasting on Ubuntu is done via right click!)
curl https://raw.githubusercontent.com/Izzy129/script/refs/heads/main/install_ros2_gazebo.sh > install_ros2_gazebo.sh
- Make script runnable
chmod +x install_ros2_gazebo.sh
- Run script
sudo bash install_ros2_gazebo.sh
- ==Make sure to press Enter when prompted!==
Troubleshooting
E: The list of sources could not be read.
If you get the following error when running the script:
Conflicting values set for option Signed-By regarding source http://packages.ros.org/ros2/ubuntu/ noble: /usr/share/keyrings
… long PGP block…
…
…
E: The list of sources could not be read.
Do this:
sudo rm /etc/apt/sources.list.d/ros2.sources
404 not found when running script
If you get 404 not found when running the script, re-download the script at step 2:
curl https://raw.githubusercontent.com/Izzy129/script/refs/heads/main/install_ros2_gazebo.sh > install_ros2_gazebo.sh
- then follow tutorial again from step 3
Other errors
- If the script still isn't working for you, use the following links to install ROS2+Gazebo manually
- ROS2: https://docs.ros.org/en/jazzy/Installation.html
- setup environment too
- Gazebo: run the following on Ubuntu
- ROS2: https://docs.ros.org/en/jazzy/Installation.html
sudo apt-get install ros-jazzy-ros-gz
- then append the following to your
~/.bashrcfile (see LINUX_BASICS_GUIDE_HERE for doing this)
# begin Rice Robotics Club stuff
source /opt/ros/jazzy/setup.bash
export ROS_DOMAIN_ID=0
export ROS_DISTRO=jazzy
# end Rice Robotics Club stuff