To get a list of debian packages required by a ROS package, you can run:
rosdep depdb rospackage(s) > debs.txt
Now you'll have to do some search-and-replace (or some nifty sed magic) to get a line-separated list of debian packages. Then you can run:
sudo xargs -d '\n' -a debs.txt aptitude markauto
... which will pipe the packages into aptitude markauto
. Using markauto
instead of remove
has the advantage that only those packages are removed that are not needed by any other package in the system. Finally, run
aptitude
... to review the list of packages that would be removed (press 'g
'). If you want to keep some package, just highlight it and press '+
' to mark it as "manually installed" again. Finally, press 'g
' again to remove the packages.