We need to create a workspace and clone the ROS-2 repository into it. You can do this using the following commands:
$ mkdir -p ~/ros2_ws/src$ cd ~/ros2_ws$ wget https://raw.githubusercontent.com/ros2/ros2/release-latest/ros2.repos
The output would be ros2.repos being saved, as shown here:
If you're an advanced user and would like to use the developmental release, simply replace release-latest with master in the preceding command. If you would like to continue experimenting, the best suggestion is to use the preceding command as is because the preceding tree would have gone through ...