It is possible to have both the ROS1 and ROS2 distributions installed on the same system simultaneously. To switch between them, use the CLI Terminal to source the appropriate workspace.
<aside> ⚠️ You need to source the every new terminal when you need to run the ROS1 or ROS2 command.
</aside>
source /opt/ros/noetic/setup.bash
source devel/setup.bash
rostopic list
This will display all the available topics for ROS1.
source /opt/ros/humble/setup.bash
source install/setup.bash
ros2 topic list
This will display all the available topics for ROS2.