# 1. Fix Ubuntu Pi apt sources first (critical on Pi Ubuntu images) # Check that noble-updates exists in your sources: grep -r "noble-updates" /etc/apt/sources.list.d/ # 2. Set locale sudo apt-get install locales -y sudo locale-gen en_US en_US.UTF-8 sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 export LANG=en_US.UTF-8 # 3. Add ROS2 apt repo (modern method using ros-apt-source) sudo apt-get install software-properties-common curl -y sudo add-apt-repository universe sudo apt-get update export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F'"' '{print $4}') curl -L -o /tmp/ros2-apt-source.deb \ "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo ${UBUNTU_CODENAME:-${VERSION_CODENAME}})_all.deb" sudo dpkg -i /tmp/ros2-apt-source.deb # 4. Install ROS2 - choose ONE: sudo apt-get update # sudo apt-get install ros-jazzy-ros-base -y # lean: no GUI tools (recommended for Pi robot brain) sudo apt-get install ros-jazzy-desktop -y # full: includes RViz, rqt (needs more RAM/disk) # 5. Install dev tools sudo apt-get install ros-dev-tools -y sudo apt-get install python3-colcon-common-extensions -y # 6. Setup rosdep sudo rosdep init rosdep update # # 7. Auto-source in .bashrc # echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc # source ~/.bashrc