ROS2 + Gazebo install

Prereqs

  1. Windows with WSL+Ubuntu 24.04 installed (see this guide on how to install WSL)
    OR
  2. Ubuntu 24.04 running natively via Dualboot or USB

Installing ROS2 + Gazebo

Automated via script

  1. Ensure you're in home
cd ~
  1. Update system packages
sudo apt update && sudo apt upgrade
  1. 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
  1. Make script runnable
chmod +x install_ros2_gazebo.sh
  1. Run script
sudo bash install_ros2_gazebo.sh

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

Other errors

sudo apt-get install ros-jazzy-ros-gz
# 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