From 458c3515852619942d9e12ef012efdf3dd0d4e35 Mon Sep 17 00:00:00 2001 From: Beniamino Pozzan <38298699+beniaminopozzan@users.noreply.github.com> Date: Wed, 1 Mar 2023 15:51:29 -0800 Subject: [PATCH] setup/ubuntu.sh: Only install Gazebo Garden for Ubuntu 22.04 (#21173) * Tools/setup/ubuntu.sh: Only install Gazebo Garden on Ubuntu 22.04 Signed-off-by: Beniamino Pozzan * Apply suggestions from code review --------- Signed-off-by: Beniamino Pozzan Co-authored-by: Hamish Willee --- Tools/setup/ubuntu.sh | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/Tools/setup/ubuntu.sh b/Tools/setup/ubuntu.sh index d7a13df4ca..af7ec2fbff 100755 --- a/Tools/setup/ubuntu.sh +++ b/Tools/setup/ubuntu.sh @@ -219,29 +219,32 @@ if [[ $INSTALL_SIM == "true" ]]; then # Set Java 11 as default sudo update-alternatives --set java $(update-alternatives --list java | grep "java-$java_version") - # Add Gazebo binary repository - sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' - wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - - # Update list, since new gazebo-stable.list has been added - sudo apt-get update -y --quiet - - # Install Gazebo + # Gazebo / Gazebo classic installation if [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then - sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \ - ignition-fortress \ - ; - fi + echo "Gazebo (Garden) will be installed" + echo "Earlier versions will be removed" + # Add Gazebo binary repository + sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null + sudo apt-get update -y --quiet - # Install Gazebo classic - if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then - gazebo_version=9 - gazebo_packages="gazebo$gazebo_version libgazebo$gazebo_version-dev" - elif [[ "${UBUNTU_RELEASE}" == "22.04" ]]; then - gazebo_packages="gazebo libgazebo-dev" + # Install Gazebo + gazebo_packages="gz-garden" else - # default and Ubuntu 20.04 - gazebo_version=11 - gazebo_packages="gazebo$gazebo_version libgazebo$gazebo_version-dev" + sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' + wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - + # Update list, since new gazebo-stable.list has been added + sudo apt-get update -y --quiet + + # Install Gazebo classic + if [[ "${UBUNTU_RELEASE}" == "18.04" ]]; then + gazebo_classic_version=9 + gazebo_packages="gazebo$gazebo_classic_version libgazebo$gazebo_classic_version-dev" + else + # default and Ubuntu 20.04 + gazebo_classic_version=11 + gazebo_packages="gazebo$gazebo_classic_version libgazebo$gazebo_classic_version-dev" + fi fi sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \