(1) Error:
Roscore operation shows that it is not installed
Press the prompt to report an error,
But it’s actually installed
(2) Solution:
vim ~/.bashrc
Delete source/opt/ROS/melody/setup.bash save and exit
Terminal recompilation
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
Press roscore again to start.