How to Check What ROS 2 Version Is Installed on Your Machine

check-ros2-distribution

Below are the various ways you can check to see what ROS 2 distribution is installed on your machine.

If you just want to see what version of ROS 2 you have, type:

ls /opt/ros/

Example return value:

jazzy

Alternatively, you can get the same output by typing either of the commands below:

printenv ROS_DISTRO
env ROS_DISTRO
echo $ROS_DISTRO

If you want to see what Python version you have along with the ROS 2 distribution that is installed, type:

env | grep ROS

If you want to see a description of all the ROS 2 packages installed on your system, type:

dpkg -l | grep ros-

That’s it! Keep building!