0

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

guiverc
  • 30,396

1 Answers1

1

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.

N0rbert
  • 99,918