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, robotstatepublisher 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 ?
Asked by sisko on 2020-11-27 13:27:38 UTC
Answers
Installing ros packages should be done using apt install ros-<distro>-<package>. I think what you want is the ros-melodic-urdf package.
Removing system packages can uninstall related packages since they are technically no longer required by the package being removed. When you use the -y flag, it will just go ahead and remove all those packages it feels are no longer needed. In the future, try remove without the -y flag. This will display a list of the packages it feels are unnecessary and you can choose not to remove then.
In this case, you can now install the ros-desktop for core packages or ros-desktop-full for rviz and gazebo and other supporting packages. apt install ros-melodic-desktop-full
Asked by Akhil Kurup on 2020-11-27 18:21:25 UTC
Comments
Removing system packages can uninstall related packages since they are technically no longer required by the package being removed.
Actually, in this case, it's most likely the other way around: ros-melodic-urdf is a dependency of many other packages. So if you ask apt to remove ros-melodic-urdf, it will do so, but it will also remove all the packages which depend on ros-melodic-urdf.
Asked by gvdhoorn on 2020-11-28 08:08:53 UTC
Yes, you're right. In this case, the user installed a package outside of ros (using apt) and I am not sure why ros packages would be removed when that is uninstalled. In any case lets see if the ros-melodic-desktop-full installs rviz again
Asked by Akhil Kurup on 2020-11-28 12:48:32 UTC
Comments
note: this is not a "ROS thing", but the way dependency resolution works in
aptand many other package managers.If A depends on B, and you remove B, the package manager will have to remove A as well.
Asked by gvdhoorn on 2020-11-28 08:49:24 UTC