Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reinit throws error #48

Open
LucidOne opened this issue Dec 30, 2012 · 7 comments
Open

reinit throws error #48

LucidOne opened this issue Dec 30, 2012 · 7 comments

Comments

@LucidOne
Copy link

running sudo rosdep init twice should update the list of sources instead of throwing an error

$ sudo rosdep init
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run

    rosdep update
$ sudo rosdep init
ERROR: default sources list file already exists:
    /etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize
@tfoote
Copy link
Member

tfoote commented Feb 4, 2013

That's going to potentially loose information that someone added to the default list. It could do a diff and only error if there's a change. Possibly with a -f option to force update w/o checking the diff. But overwrite of user configuration should not be the default.

@tfoote
Copy link
Member

tfoote commented Feb 5, 2013

From #202 it's important to be able to rewrite the sources when a new distro comes out. The -f will work well.

@baalexander
Copy link

Is the -f argument available in rosdep?

We're calling rosdep init in our deployment scripts, which may run more than once on a server. My initial expectation was if rosdep was already initialized, calling rosdep init again would just be ignored. If there's not a -f option, is there a rosdep clean or rosdep remove like command? Or am I best off just deleting /etc/ros/rosdep/sources.list.d/*?

@tfoote
Copy link
Member

tfoote commented May 22, 2013

Right now the best solution is to use rm first. There's an effort to clean this up in process but it hasn't landed yet: read more at https://groups.google.com/forum/?fromgroups#!topic/ros-sig-buildsystem/BsUsgGPbubQ

@Lome789
Copy link

Lome789 commented Sep 26, 2015

@wjwwood excuse me, how to use -f or remove default sources list file?

@tfoote
Copy link
Member

tfoote commented Sep 26, 2015

You can remove the sources with sudo rm -rf /etc/ros/rosdep/sources.list.d/* followed by sudo rosdep init to get the default sources back.

@130s
Copy link

130s commented Apr 12, 2018

$ sudo rosdep init
ERROR: default sources list file already exists:
    /etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize

Could the return code be just warning message instead of error?

I see this error often with custom Dockerfiles when switching a basis image from one where rosdep init hasn't run before to one that has already had it run. In that case the entire docker build stops due to rosdep init error. While this particular behavior can be worked around (e.g. use semicolon like RUN sudo rosdep init; rosdep update), returning error seems to me a bit overreacting.

That said, changing the return code could break other existing tools, so I don't foresee this behavior to change. Just a thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants