Skip to content

Commit 243c834

Browse files
Merge pull request #76 from atom-robotics-lab/adityadev/rosinstallations
Adityadev/rosinstallations
2 parents bcd2f43 + bcf023a commit 243c834

1 file changed

Lines changed: 25 additions & 5 deletions

File tree

markdown/ros/ROS_installation/ROS_index.rst

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,31 @@ First ensure that the `Ubuntu Universe repository <https://help.ubuntu.com/commu
4747
sudo apt install software-properties-common
4848
sudo add-apt-repository universe
4949
50-
Now add the ROS 2 GPG key with apt.
50+
The `ros-apt-source packages <https://github.com/ros-infrastructure/ros-apt-source/>`_ provide keys and apt source configuration for the various ROS repositories.
51+
52+
Installing the ros2-apt-source package will configure ROS 2 repositories for your system. Updates to repository
53+
configuration will occur automatically when new versions of this package are released to the ROS repositories.
5154

5255
.. code-block:: bash
5356
5457
sudo apt update && sudo apt install curl -y
55-
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
58+
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}')
59+
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 $VERSION_CODENAME)_all.deb" # If using Ubuntu derivates use $UBUNTU_CODENAME
60+
sudo dpkg -i /tmp/ros2-apt-source.deb
5661
57-
Then add the repository to your sources list.
5862
59-
.. code-block:: bash
63+
.. Now add the ROS 2 GPG key with apt.
64+
65+
.. .. code-block:: bash
66+
67+
.. sudo apt update && sudo apt install curl -y
68+
.. sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
69+
70+
.. Then add the repository to your sources list.
6071
61-
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
72+
.. .. code-block:: bash
73+
74+
.. 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
6275
6376
Install ROS 2 packages
6477
----------------------
@@ -69,6 +82,13 @@ Update your apt repository caches after setting up the repositories.
6982
7083
sudo apt update
7184
85+
ROS 2 packages are built on frequently updated Ubuntu systems. It is always recommended that you ensure your system is up to
86+
date before installing new packages.
87+
88+
.. code-block:: bash
89+
90+
sudo apt upgrade
91+
7292
.. include:: _Apt-Upgrade-Admonition.rst
7393

7494
.. warning::

0 commit comments

Comments
 (0)