Score:0

Malformed entry in sources.list after Impish upgrade

fr flag

There are a lot of answers related somewhat to this question, but doesn't seem to help as I didn't had this error before. This error came after upgrading to Ubuntu Impish from 21.04

$ sudo apt-get update
[sudo] password for kirti: 
E: Malformed entry 2 in list file /etc/apt/sources.list.d/pgdg.list (Suite)
E: The list of sources could not be read.
$ cat /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt impish-pgdg main
deb http://apt.postgresql.org/pub/repos/apt/
impish-pgdg main
$ 

I had postgresql installed before update. Though, postgresql works fine I'm not able to perform certain tasks on terminal, let it be a simple update

Can somebody please help me?

pgdg.list: enter image description here



Also I don't know why by default it is selected as postgresql in ubuntu update.
enter image description here

in flag
Can you post the contents of `pgdg.list`? This will make it easier to spot the error
kirti purohit avatar
fr flag
I've added @matigo
user535733 avatar
cn flag
Seems like sometime you tried to add the same source a second time...but made a typo. Line 1 is correct. Lines 2+3 say the same thing, but spread across two lines is the error. Simply delete lines 2 and 3.
kirti purohit avatar
fr flag
No its' the same content, I wanted to show
user535733 avatar
cn flag
Confused what you are trying to say. We cannot see nonverbal cues, so please try to be clear and unambiguous in your writing. Regardless, simply delete lines 2 and 3, then save the file.
kirti purohit avatar
fr flag
You sure I should delete the 2 lines?
user535733 avatar
cn flag
Alternately, you could simply comment those two lines out. Prepend a `#` on lines 2 and 3, then save.
user535733 avatar
cn flag
Why that source is selected in your Software & Updates control panel is a different question. It's best to keep questions simple. The short answer is that the source is selected *because you use it*. Unselected sources are disabled (unused).
Organic Marble avatar
us flag
Does this answer your question? [How do I remove a malformed line from my sources.list?](https://askubuntu.com/questions/78951/how-do-i-remove-a-malformed-line-from-my-sources-list)
Score:1
zw flag

You have to rewrite this sources.list file using single long command below:

cat << EOF | sudo tee /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt impish-pgdg main
deb http://apt.postgresql.org/pub/repos/apt/ impish-pgdg main
EOF

Note that lines 2 and 3 are now one line with deb package type, its url, version and component. So it conforms with normal correct sources.list style format.

Then run sudo apt-get update again.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.