Skip to content

Add $ to Installation #5356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 49 additions & 41 deletions source/Installation/Maintaining-a-Source-Checkout.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,35 @@ If you wish to checkout the latest code for ROS 2 {DISTRO_TITLE}, you can get th

.. group-tab:: Linux

.. code-block:: bash
.. code-block:: console

cd ~/ros2_{DISTRO}
mv -i ros2.repos ros2.repos.old
wget https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos
$ cd ~/ros2_{DISTRO}
$ mv -i ros2.repos ros2.repos.old
$ wget https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos

.. group-tab:: macOS

.. code-block:: bash
.. code-block:: console

cd ~/ros2_{DISTRO}
mv -i ros2.repos ros2.repos.old
wget https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos
$ cd ~/ros2_{DISTRO}
$ mv -i ros2.repos ros2.repos.old
$ wget https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos

.. group-tab:: Windows

.. code-block:: bash
Use a Windows comand line interface:

# CMD
cd \dev\ros2_{DISTRO}
curl -sk https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
.. code-block:: console

# PowerShell
cd \dev\ros2_{DISTRO}
curl https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos
$ cd \dev\ros2_{DISTRO}
$ curl -sk https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos

Or a powershell:

.. code-block:: console

$ cd \dev\ros2_{DISTRO}
$ curl https://raw.githubusercontent.com/ros2/ros2/{REPOS_FILE_BRANCH}/ros2.repos -o ros2.repos


Update your repositories
Expand All @@ -66,9 +70,9 @@ You will notice that in the `ros2.repos <https://raw.githubusercontent.com/ros2/
It is possible that these versions refer to new tags/branches that your local copy of the repositories will not recognize as they are out-of-date.
Because of this, you should update the repositories that you have already checked out with the following command:

.. code-block:: bash
.. code-block:: console

vcs custom --args remote update
$ vcs custom --args remote update

Download the new source code
----------------------------
Expand All @@ -79,38 +83,42 @@ You should now be able to download the sources associated with the new repositor

.. group-tab:: Linux

.. code-block:: bash
.. code-block:: console

vcs import src < ros2.repos
vcs pull src
$ vcs import src < ros2.repos
$ vcs pull src

.. group-tab:: macOS

.. code-block:: bash
.. code-block:: console

vcs import src < ros2.repos
vcs pull src
$ vcs import src < ros2.repos
$ vcs pull src

.. group-tab:: Windows

.. code-block:: bash
In a Windows command line interface:

.. code-block:: console

$ vcs import --input ros2.repos src
$ vcs pull src

Or in powershell:

# CMD
vcs import src < ros2.repos
vcs pull src
.. code-block:: console

# PowerShell
vcs import --input ros2.repos src
vcs pull src
$ vcs import --input ros2.repos src
$ vcs pull src

Rebuild your workspace
----------------------

Now that the workspace is up to date with the latest sources, remove your previous install and rebuild your workspace with, for example:

.. code-block:: bash
.. code-block:: console

colcon build --symlink-install
$ colcon build --symlink-install

Inspect your source checkout
----------------------------
Expand All @@ -122,23 +130,23 @@ If you wish to know the versions of the set of repositories in your workspace, y

.. group-tab:: Linux

.. code-block:: bash
.. code-block:: console

cd ~/ros2_{DISTRO}
vcs export src > my_ros2.repos
$ cd ~/ros2_{DISTRO}
$ vcs export src > my_ros2.repos

.. group-tab:: macOS

.. code-block:: bash
.. code-block:: console

cd ~/ros2_{DISTRO}
vcs export src > my_ros2.repos
$ cd ~/ros2_{DISTRO}
$ vcs export src > my_ros2.repos

.. group-tab:: Windows

.. code-block:: bash
.. code-block:: console

cd \dev\ros2_{DISTRO}
vcs export src > my_ros2.repos
$ cd \dev\ros2_{DISTRO}
$ vcs export src > my_ros2.repos

This ``my_ros2.repos`` file can then be shared with others so that they can reproduce the state of the repositories in your workspace.
61 changes: 32 additions & 29 deletions source/Installation/RHEL-Install-RPMs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,36 @@ Enable required repositories

You will need to enable the EPEL repositories and the PowerTools repository:

.. code-block:: bash
.. code-block:: console

sudo dnf install 'dnf-command(config-manager)' epel-release -y
sudo dnf config-manager --set-enabled crb
$ sudo dnf install 'dnf-command(config-manager)' epel-release -y
$ sudo dnf config-manager --set-enabled crb

.. note:: This step may be slightly different depending on the distribution you are using.
`Check the EPEL documentation <https://docs.fedoraproject.org/en-US/epel/#_quickstart>`_

Next, download the ROS 2 ``.repo`` file:

.. code-block:: bash
.. code-block:: console

sudo dnf install curl
sudo curl --output /etc/yum.repos.d/ros2.repo http://packages.ros.org/ros2/rhel/ros2.repo
$ sudo dnf install curl
$ sudo curl --output /etc/yum.repos.d/ros2.repo http://packages.ros.org/ros2/rhel/ros2.repo

Then, update your metadata cache.
DNF may prompt you to verify the GPG key, which should match the location ``https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc``.

.. code-block:: bash
.. code-block:: console

sudo dnf makecache
$ sudo dnf makecache

Install development tools (optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you are going to build ROS packages or otherwise do development, you can also install the development tools:

.. code-block:: bash
.. code-block:: console

sudo dnf install -y \
$ sudo dnf install -y \
cmake \
gcc-c++ \
git \
Expand All @@ -78,9 +78,9 @@ If you are going to build ROS packages or otherwise do development, you can also
python3-vcstool \
wget

# install some pip packages needed for testing and
# not available as RPMs
python3 -m pip install -U --user \
~ install some pip packages needed for testing and
~ not available as RPMs
$ python3 -m pip install -U --user \
flake8-blind-except==0.1.1 \
flake8-class-newline \
flake8-deprecated
Expand All @@ -92,16 +92,16 @@ Install ROS 2

Desktop Install (Recommended): ROS, RViz, demos, tutorials.

.. code-block:: bash
.. code-block:: console

sudo dnf install ros-{DISTRO}-desktop
$ sudo dnf install ros-{DISTRO}-desktop

ROS-Base Install (Bare Bones): Communication libraries, message packages, command line tools.
No GUI tools.

.. code-block:: bash
.. code-block:: console

sudo dnf install ros-{DISTRO}-ros-base
$ sudo dnf install ros-{DISTRO}-ros-base

Install additional RMW implementations (optional)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -114,11 +114,14 @@ Setup environment

Set up your environment by sourcing the following file.

.. code-block:: bash
.. code-block:: console

# Replace ".bash" with your shell if you're not using bash
# Possible values are: setup.bash, setup.sh, setup.zsh
source /opt/ros/{DISTRO}/setup.bash
$ source /opt/ros/{DISTRO}/setup.bash

.. note::

Replace ``.bash`` with your shell if you're not using console.
Possible values are: ``setup.bash``, ``setup.sh``, ``setup.zsh``.

Try some examples
-----------------
Expand All @@ -127,17 +130,17 @@ If you installed ``ros-{DISTRO}-desktop`` above you can try some examples.

In one terminal, source the setup file and then run a C++ ``talker``\ :

.. code-block:: bash
.. code-block:: console

source /opt/ros/{DISTRO}/setup.bash
ros2 run demo_nodes_cpp talker
$ source /opt/ros/{DISTRO}/setup.bash
$ ros2 run demo_nodes_cpp talker

In another terminal source the setup file and then run a Python ``listener``\ :

.. code-block:: bash
.. code-block:: console

source /opt/ros/{DISTRO}/setup.bash
ros2 run demo_nodes_py listener
$ source /opt/ros/{DISTRO}/setup.bash
$ ros2 run demo_nodes_py listener

You should see the ``talker`` saying that it's ``Publishing`` messages and the ``listener`` saying ``I heard`` those messages.
This verifies both the C++ and Python APIs are working properly.
Expand All @@ -159,6 +162,6 @@ Uninstall
If you need to uninstall ROS 2 or switch to a source-based install once you
have already installed from binaries, run the following command:

.. code-block:: bash
.. code-block:: console

sudo dnf remove ros-{DISTRO}-*
$ sudo dnf remove ros-{DISTRO}-*
38 changes: 19 additions & 19 deletions source/Installation/Testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,42 @@ For Debian-based operating systems, you can install binary packages from the **r
2. Edit (with sudo) the file ``/etc/apt/sources.list.d/ros2.list`` and change ``ros2`` with ``ros2-testing``.
For example, on Ubuntu Noble the contents should look like the following:

.. code-block:: sh
.. code-block:: bash

# deb http://packages.ros.org/ros2/ubuntu noble main
deb http://packages.ros.org/ros2-testing/ubuntu noble main

3. Update the ``apt`` index:

.. code-block:: sh
.. code-block:: console

sudo apt update
$ sudo apt update

4. You can now install individual packages from the testing repository, for example:

.. code-block:: sh
.. code-block:: console

sudo apt install ros-{DISTRO}-my-just-released-package
$ sudo apt install ros-{DISTRO}-my-just-released-package

5. Alternatively, you can move your entire ROS 2 installation to the testing repository:

.. code-block:: sh
.. code-block:: console

sudo apt dist-upgrade
$ sudo apt dist-upgrade

6. Once you are finished testing, you can switch back to the normal repository by changing back the contents of ``/etc/apt/sources.list.d/ros2.list``:

.. code-block:: sh
.. code-block:: bash

deb http://packages.ros.org/ros2/ubuntu noble main
# deb http://packages.ros.org/ros2-testing/ubuntu noble main

and doing an update and upgrade:

.. code-block:: sh
.. code-block:: console

sudo apt update
sudo apt dist-upgrade
$ sudo apt update
$ sudo apt dist-upgrade

.. _Prerelease_binaries:

Expand All @@ -85,15 +85,15 @@ These packaging jobs produce archives with pre-built binaries that can be downlo

.. group-tab:: Ubuntu Linux and RHEL

.. code-block:: sh
.. code-block:: console

source path/to/extracted/archive/setup.bash
$ source path/to/extracted/archive/setup.bash

.. group-tab:: Windows

.. code-block:: sh
.. code-block:: console

call path\to\extracted\archive\setup.bat
$ call path\to\extracted\archive\setup.bat

Docker
------
Expand All @@ -102,14 +102,14 @@ For Ubuntu Linux, there is also a nightly Docker image based on the nightly bina

1. Pull the Docker image:

.. code-block:: sh
.. code-block:: console

docker pull osrf/ros2:nightly
$ docker pull osrf/ros2:nightly

2. Start an interactive container:

.. code-block:: sh
.. code-block:: console

docker run -it osrf/ros2:nightly
$ docker run -it osrf/ros2:nightly

For support on running GUI applications in Docker, take a look at the tutorial `User GUI's with Docker <https://wiki.ros.org/docker/Tutorials/GUI>`_ or the tool `rocker <https://github.com/osrf/rocker>`_.
Loading