E: Malformed entry 1 in list file /etc/apt/sources.list.d/ros-latest.list (Component) E: The list of sources could not be read.

asked 2022-02-01 18:18:48 -0600

chocolate_milk gravatar image

So I'm trying to install ros melodic in ubuntu within a dockerfile by following

http://wiki.ros.org/melodic/Installat... . Thus, this is what i'm running, which is in a dockerfile:

RUN sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - 
RUN apt-get update && apt-get install ros-melodic-desktop-full

but it's giving me this error:

E: Malformed entry 1 in list file /etc/apt/sources.list.d/ros-latest.list (Component)
E: The list of sources could not be read.

Removing the list of sources doesn't work. I assume there is something in the list that is somehow wrong even though I didn't touch it. What could be the problem and how would I go about solving it?

edit retag flag offensive close merge delete