1

I got this error while upgrading from ubuntu 17.04 to 17.10 saying that I have configured sources.list file multiple times. please help

karel
  • 114,770
Suhail
  • 111
  • 1
    Since install of Ubuntu 17.04 you've edited the /etc/apt/sources.list (and any in 'sources.list.d') and added extra lines creating the duplicates rather than checking to see if they already exist, and thus not adding them a second time. You only need to look at the files (looking for lines containing the text in the warnings) and remove or comment out (put a # at beginning of the line, allowing restoration if you # the wrong line) the duplicates. Also note they likely be "W:" messages, or WARNINGS and NOT errors. (note: "got this error" but you didn't provide the error) – guiverc Feb 11 '18 at 07:23
  • "got this error = configured sources.list file multiple times" . thank you for the solution – Suhail Jun 12 '18 at 05:46

1 Answers1

1

Check for duplicate sources with this command (source):

S="/etc/apt/sources.list" ; S2="$S ${S}.d/*.list" ; grep -b "^deb`cat $S2 | grep -i "^deb[[:space:]]http" | sort | uniq -dc | sed -e 's;[[:space:]]\+[[:digit:]]\+[[:space:]]\+deb\(.\+$\);\1;g'`$" $S2

(You will set 2 error messages if /etc/apt/sources.list.d/ directory is empty. That's ok.)

If you see any red text lines on the output of this command -> then you have to edit the according file(s) and remove the duplicate entries.

Bob
  • 401