0
$\begingroup$

Rosanswers logo

I'm using Ubuntu 16.04 I had ROS Kinetic installed following the tutorial and it was working. I was experiencing errors with a tutorial, covered here, so I removed ROS in order to do a complete fresh install. I did so by using:

sudo apt-get remove ros-kinetic-desktop-full 
sudo apt-get remove python-rosinstall
sudo rm -fr /etc/ros
sudo rm -fr /opt/ros
sudo rm -fr ~/.ros
sudo apt-get autoremove

To purge my system of my first ROS install.

I then reapplied all the directions given in the installation tutorial.

It seems however the the 'setup.bash' file is not installed the second time around. When I ls /opt/ros/kinetic I get only the following:

philglau@phil-glau-ubuntu-16:/opt/ros/kinetic$ ls
bin  etc  include  lib  share

The 'setup.bash' script is missing !! (using du -hs indicates there are 145MB of other files in this /kinetic folder, so it's not like it didn't install most of the stuff.) Furthermore, when I installed the second time, it gave absolutely no errors or warning to indicate that something was missing or wrong.

This is from dpkg -l

philglau@phil-glau-ubuntu-16:~$ dpkg -l | grep ros-kinetic-catkin
ii  ros-kinetic-catkin                           0.7.6-0xenial-20170217-212821-0800                    amd64        Low-level build system macros and infrastructure for RO

Can't figure out why this is. Did I do something incorrect when uninstalling the original version like forget some other cache or directory??

Is it possible to just manually install the missing setup.bash script? If so where would I get it?

Thank you in advance for your help.


Originally posted by philglau on ROS Answers with karma: 248 on 2017-03-18

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

sudo apt-get remove ros-kinetic-desktop-full
...
sudo rm -fr /opt/ros
...
sudo apt-get autoremove

Not sure, but it could be that apt did not remove ros-kinetic-catkin with the autoremove, and then when you installed everything the second time, dependency resolution determined that the package ros-kinetic-catkin was already installed, so it skipped it.

But because you rm -fr /opt/ros before, the files are not actually there anymore.

Can you check whether a sudo apt-get install --reinstall ros-kinetic-catkin gets the files back?


Btw: I would never (well, never ..) rm -rf files or directories that were installed by a package manager. Use apt-get remove or apt-get purge with a regex or a package list. If there are still files left after running that, then removing them manually could be acceptable.


Originally posted by gvdhoorn with karma: 86574 on 2017-03-19

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by philglau on 2017-03-19:
Thank you for the advice regarding using remove and purge. I will use that going forward. I ran sudo apt-get install --reinstall ros-kinetic-catkin and it does appear to have placed the missing files into /opt/ros/kinetic/. Thank you.

Comment by philglau on 2017-03-19:
I should have been clearer above I had actually run sudo apt autoremove prior to running the rm -fr commands. After running sudo apt autoremove, I was still left with a /opt/ros/kenetic/ directory, that was mostly empty except for folders, thus the rm -fr to get rid of final remnants.

Comment by luisfelipewb on 2018-11-07:
More than on year later, I had exactly the same problem and the same solution worked for me :) Thanks!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.