How do I fix the malformed line from my source.list?

Acho que estás a falar português.)

Por favor, abra uma janela de terminal e escreva o seguinte comando:

nl /etc/apt/sources.list

Copie o resultado desse comando e cole-o num post aqui. :warning: Certifique-se que selecciona o resultado desse comando que acabou de colar numa publicação e depois carregue no ícone </> da barra de ferramentas imediatamente acima do editor de mensagens. Isso torna a saída mais fácil para nós de ler.

hello my ubuntu is displaying the following error. Malformed entry 1 in list file /etc/apt/sources.list.d/archive_uri-http_deb_torproject_org_torproject_org-hirsute.list (Component)
E: The list of sources could not be read. i tried to install tor then i removed it from software and updates.now i cannot update

Welcome, @infinite_joker. :wave: :ubuntu_mate:

The output of that command points you to a specific file where the error is located.

Please run the following command to print the contents of that file, complete with line numbers:

nl '/etc/apt/sources.list.d/archive_uri-http_deb_torproject_org_torproject_org-hirsute.list'

Copy the output of that command into a post here. Also, please then highlight the text you just pasted, and click the </> button above the post editor's text area. (By clicking the </> button, it makes the text easier for me to read.) Chances are, there's just a missing whitespace or something in the file, and I'll tell you how to change the file after you've shown me its contents.

Thanks so much I managed to remove the source from sources and updates and then I was able to run apt update

i am biggener in ubuntu ,
when i write sudo apt-get update : give me this massage i tried all above sloution but didnt work
E: Malformed line 1 in source list /etc/apt/sources.list.d/AdobeConnect.list (type)
E: The list of sources could not be read.
what can i do

As has been said above (almost literally) two dozen times...

...please print the contents of that file which is causing the error, using this terminal command:

cat /etc/apt/sources.list.d/AdobeConnect.list

Then copy that output from the terminal window into a post here.

Then, highlight the text that you just pasted into your post, and click the </> button right above the post editor text box.

Finally, submit your post.

Once we can read what line 1 (and subsequent lines) of the file contain, then we can help you.

E: Type 'sudo' is not known on line 3 in source list /etc/apt/sources.list
E: Type 'sudo' is not known on line 3 in source list /etc/apt/sources.list.d/virtualbox.list
E: The list of sources could not be read.

please help in this error sir

Welcome Sankalp,

Please follow advice of @gordon :

As has been said above (almost literally) two dozen times...

please print the contents of that file which is causing the error, using this terminal command:
cat /etc/apt/sources.list

Then copy that output from the terminal window into a post here.

Then, highlight the text that you just pasted into your post, and click the </> button right above the post editor text box.

Then press [enter] three times

Then print the contents of the next file which is causing the error, using this terminal command:
cat /etc/apt/sources.list.d/virtualbox.list

Then copy that output from the terminal window into a post here.

Then, highlight the text that you just pasted into your post, and click the </> button right above the post editor text box.

Finally, submit your post.

Once we can read what line 3 (and subsequent lines) of the files contain, then we can help you.

1 Like

As i am new here, i can only post 1 line of text.

Hi chad, welcome to the community :slight_smile:

Let's tackle the errors one by one:

E: Malformed line 2 in source list /etc/apt/sources.list.d/xenial.list
E: The list of sources could not be read

The second line in your /etc/apt/sources.list.d/xenial.list file contains an error. Please post the contents of that file instead of the contents of /etc/apt/sources.list so that we can check what's wrong with it. :slight_smile:

E: Could not open lock file ... (13: Permission denied)
E: Unable to acquire the dpkg frontend lock ... , are you root ?

Ah yes, be aware that Linux based systems are case sensitive:
sudo apt update will work
Sudo apt update won't work

b.t.w. I see that you are running Ubuntu-MATE 21.04 (hirsute) but that the file containing the error is from Ubuntu-MATE 16.04 (xenial). You probably don't need it. :slight_smile:

my /etc/apt/sources.list.d/xenial.list

deb http://archive.ubuntu.com/ubuntu xenial main restricted universe
multiverse

i am running ubuntu studio Ubuntu 20.04.3 LTS

i was using a text program so it capitalized the sudo to Sudo. in terminal i use sudo apt update

my /etc/apt/sources.list.d/xenial.list

deb http://archive.ubuntu.com/ubuntu xenial main restricted universe
multiverse

Hmm...I guess you have some hidden characters in there because if this was all, it would update without problem (I've checked/tested that).
Possibly this file has been edited in a wordprocessor or was constructed on a windows computer (malformed line-endings)

But anyway, that xenial.list file is useless and could potentially create other problems.

It is de default repository from almost 5 years ago ( it is 8 versions older than your current setup). If you could install something from it (which I doubt) it will probably not work anyway because lots of things have changed since then (libraries etc.).

Best to delete the /etc/apt/sources.list.d/xenial.list file altogether.

P.S: I have ubuntu-studio 20.04.3 on my recording room laptop.
The /etc/apt/sources.list.d directory on there is completely empty.

Good morning friends, this is sharif software engineer from openMRS, am facing this issue while am trying out a new linux distribution version 22.04.1 LTS

I have tried out all the above suggestions but its seems the problem is the issue, could this be a problem of linux version.
Thanks alot
Regards
Sharif
cc @pavlos_kairis

Welcome Sharif,

Please follow advice of @gordon :

As has been said above (almost literally) two dozen times...

please print the contents of that file which is causing the error, using this terminal command:
cat /etc/apt/sources.list.d/google.list

Then copy that output from the terminal window into a post here.

Then, highlight the text that you just pasted into your post, and click the </> button right above the post editor text box.

Finally, submit your post.

Once we can read what line 2 (and subsequent lines) of the files contain, then we can help you.


i have this

1 Like


this error is coming why

Screenshot from 2023-10-28 12-08-13

Welcome @Krish_Mittal_IIT_Man to the community!

@Krish_Mittal_IIT_Man

you seem to mix focal (20.04) with jammy (22.04) repositories.

paste inxi -r it should be a few lines.

1 Like

where to paste the inxi-r
and how to correct to jammy(22.04)