Skip to content

Commit 7b65f0a

Browse files
update Ubuntu installation to use ros-apt-source
1 parent 6b93e4d commit 7b65f0a

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

source/Installation/_Apt-Repositories.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ First ensure that the `Ubuntu Universe repository <https://help.ubuntu.com/commu
77
$ sudo apt install software-properties-common
88
$ sudo add-apt-repository universe
99
10-
Now add the ROS 2 GPG key with apt.
10+
The `ros-apt-source <https://github.com/ros-infrastructure/ros-apt-source/>`_ packages provide keys and apt source configuration for the various ROS repositories.
1111

12-
.. code-block:: console
13-
14-
$ sudo apt update && sudo apt install curl -y
15-
$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
16-
17-
Then add the repository to your sources list.
12+
Installing the ros2-apt-source package will configure ROS 2 repositories for your system.
13+
Updates to repository configuration will occur automatically when new versions of this package are released to the ROS repositories.
1814

1915
.. code-block:: console
2016
21-
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
17+
$ sudo apt update && sudo apt install curl -y
18+
$ 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}')
19+
$ curl -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 $VERSION_CODENAME)_all.deb" # If using Ubuntu derivates use $UBUNTU_CODENAME
20+
$ sudo apt install /tmp/ros2-apt-source.deb

0 commit comments

Comments
 (0)