3

This question already has an answer here:

Here is the error message:

E: Malformed entry 1 in list file /etc/apt/sources.list.d/ros-latest.list (Component)

This is what's written in my file:

deb http://packages.ros.org/ros/ubuntu $
(lsb_release -sc) main

What is wrong?

marked as duplicate by karel, heemayl, David Foerster, user364819, Eric Carvalho May 5 '17 at 0:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    is that 2 or 1 lines? – Rinzwind May 4 '17 at 14:00
7

The correct entry for the file should look something like this:

deb http://packages.ros.org/ros/ubuntu zesty main

where zesty should be replaced with the codename of your ubuntu release version.

The $(lsb_release -sc) is supposed to be a shell script command that would be expanded by the shell (e.g. bash) when you type something like this in the terminal:

echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/ros-latest.list

The shell command above are supposed to call the lsb_release command to figure out the correct ubuntu codename (e.g. zesty for 17.04, yakkety for 16.10, xenial for 16.04). The output of lsb_release which should be the ubuntu release codename would then be interpolated into the string between the quotes and then written to the file /etc/apt/sources.list.d/ros-latest.list.

However, you must have put an extra space between $ and ( when typing the command, which causes the $ (lsb_release -sc) to be written literally, instead of having the output of the lsb_release command interpolated into the config file.

  • 1
    Good one on the space! :) +1 – Rinzwind May 4 '17 at 14:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.