Rviz and other packages unexpectedly removed
I had my ROS Melodic environment perfectly setup. I was able to launch my package and see my robot model in Rviz.
I tried finding and installing the URDF package as an Ubuntu linux package by the following command:
sudo apt-get install liburdfdom-tools -y
It seemed to be the wrong package so I uninstalled it using:
sudo apt-get remove --purge ros-melodic-urdf -y
The output shocked me. It reported that a lot of packages had been uninstalled including Ros-Melodic-Desktop-Ful, robot_state_publisher etc.
I restarted my computer and tried running my package and confirmed my suspision - Rviz was no longer on my system.
What I would like to understand is why as my uninstall command did not specify Rviz ?
note: this is not a "ROS thing", but the way dependency resolution works in
apt
and many other package managers.If A depends on B, and you remove B, the package manager will have to remove A as well.