Sudo apt-get function not working

Hi there, I am pretty new with Raspberry Pis and have run into an issue when trying to use the "sudo apt-get upgrade" function.

For context I tried to install InfluxDB yesterday, following the instructions online - and i dont think it worked, or something happened with the install.

The problem I am encountering is that when I execute the command "sudo apt-get update" it comes up with an error message saying - "E: Malformed entry 1 in list file /etc/apt/sources.list.d/influxdb.list (Component)
E: The list of sources could not be read."

I have tried to replace the source in nano using "sudo more /etc/apt/sources.list" but it didnt make a difference.

When I use the command "sudo more /etc/apt/sources.list" I get this - deb Index of /raspbian bullseye main contrib non-free rpi
"# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb InfluxData - Package Repository $(lsb_release -cs) stable

I am at a lost end as I have no idea what to fix, any advice would be hugely appreciated.

Many thanks in advance!

1 Like

Welcome @Grayling to the community!

Thanks, do you have any ideas about how to fix my issue?

1 Like

If someone doesn't recognize your specific problem from your description I would do the following.

Start from scratch and document each step that it takes to get to the failure point.

This includes the name of the operating system, version number used, commands entered following first boot, etc.

With this information others can recreate the problem and may be able to add insight.

1 Like

Did you install Raspbian or Ubuntu MATE on the pi?

If you installed Ubuntu MATE the file is /etc/apt/sources.list.d/influxdb.list
first line should be
deb $(lsb_release -cs) stable

If you installed Raspbian, first line should be
deb $(lsb_release -cs) stable

1 Like