"Malformed entry 1 in list file" on sudo apt commands.

asked 2022-07-15 10:14:37 -0500

NiallRM gravatar image

I am running ROS2 Foxy on Ubuntu 20.04.4. I have been building/running a workspace without issues so my base Foxy installation is at least functional, but there seems to be a problem with installing dependencies.

I am trying to install Nav2, but I keep running into the following error:

$ sudo apt install ros-foxy-navigation2 

E: Malformed entry 1 in list file /etc/apt/sources.list.d/ros2.list ([option] not assignment)
E: The list of sources could not be read.

I found a similar question on this forum, but their solution doesn't seem to be helping. Here is some more information following that thread:

Contents of my ros-latest.list:

$ cat /etc/apt/sources.list.d/ros-latest.list

# deb http://packages.ros.org/ros/ubuntu focal main # disabled on upgrade to focal

Trying lsb-release:

$ lsb_release -sc


Finally, here are the contents of ros2.list itself:

deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main

I would guess that the problem has to do with "disabled on upgrade to focal" but I cannot find any ways to change this. The same error has also occurred while trying other "sudo apt" commands.

edit retag flag offensive close merge delete