The problem with bash:/opt/ros/indig/setup.bash:no such file or directory always appears when you open a terminal in Linux some time ago. This issue is related to the bash that is loaded each time the terminal is opened, so the documentation for Bash knows:
/etc/profile: This file sets the environment information for each user of the system, and when the user logs on for the first time, the file is executed and the shell's settings are collected from the/ETC/PROFILE.D directory's configuration file.
/ETC/BASHRC: This file is executed for each user running the bash shell. When the bash shell is opened, the file is read.
~/.bash_profile: Each user can use this file to enter shell information dedicated to their own use, and the file is executed only once when the user logs on! By default, he sets some environment variables to execute the user's. bashrc file.
~/.BASHRC: This file contains bash information dedicated to your bash shell, which is read when you log in and each time you open a new shell.
~/.bash_logout: Executes the file every time you exit the system (the Bash shell is exited).
I opened the files one at a ~/.BASHRC, and finally found the last line in the file: Source/opt/ros/indig/setup.bash and this bash file doesn't exist in the file system, so I deleted it. It is normal to start the terminal later.
Another: we can pass
echo "Source/opt/ros/indigo/setup.bash" >> ~/.BASHRC
command to add a path to the. bashrc file.
And then through
SOURCE ~/.BASHRC
order to bring it into force.