Score:3

Sudo apt-update && upgrade issue?

kw flag

So I am running WSL 2, and acquired the ubuntu 20.04 LTS installation through the windows store.

I have downloaded a few programs like (Python 3 et el). I also know I have to keep my system up to date. Although I have not touched the kernel upgrade stuff. I have been using the commands sudo apt-update and then sudo apt-upgrade.

This was great for the first two to three months until these messages started to appear.

W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/pgdg.list:1 and /etc/apt/sources.list.d/pgdg.list:2

Now can someone explain what is actually going on, why are they configured multiple times? Are these backups? How do I go about tidying the multiple logs up? Is it safe to do so? Little confused here. All feedback grateful and welcome. Thank you in advanced.

Big Edit:

shanzem@Shanzem-Laptop:~$ cat /etc/apt/sources.list.d/pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main

How Bizarre! going to comment out line 2! will post results.

PROBLEM SOLVED

Score:7
bo flag

As explained in other answers like this one and this one, your problem is duplicate sources in one of your sources.list files.

The error states that the problem is with the file /etc/apt/sources.list.d/pgdg.list

The error also states that the duplicate is listed on line 1 and line 2 of the file.

You can use the following command to edit the file:

sudo nano /etc/apt/sources.list.d/pgdg.list

Use this text editor mode to remove duplicate lines.

If line 1 and line 2 are identical, delete one of the two lines and then press CTRL+o to save the file and then press CTRL+x to exit nano.

After you edit the file, run the following commands to update your package list and upgrade (update) your software to the newest versions:

sudo apt update
sudo apt upgrade

If the two lines are not identical, please edit your question and post the contents of your /etc/apt/sources.list.d/pgdg.list file so I can provide more detailed instructions.

Shanzem avatar
kw flag
Thank you! will do!
mchid avatar
bo flag
@Shanzem Awesome. If this fixed your problem, please click the checkmark icon to the left of the answer to mark it as the accepted solution. Thanks.
Shanzem avatar
kw flag
Solved thank you! :D
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.