setup files of ros are set in setup.bash and have to be sourced everytime a terminal is open

/opt/ros/humble/setup.bash

Using ~/.bashrc

.bashrc is a file that runs by default when a terminal/shell is open. I will edit this to make the process of sourcing simpler

  1. Open your bashrc:
nano ~/.bashrc

  1. Add at the very bottom:
alias humble="source /opt/ros/humble/setup.bash && echo 'ROS2 Humble activated βœ…'"

#alias - shortcut for long command, allows to just type humble to activate the green part

#source - runs a script

#echo - just like print() but in terminal
  1. Save and open new terminal, now your new terminal has the changes applied
  2. Now just type:
humble

πŸ‘‰ and it’ll source ROS2 Humble for you, plus print ROS2 Humble activated βœ….