How to fix error W: Target Packages (main/binary-amd64/Packages) is configured multiple times in my sources.list file?
Solution 1
main
, universe
, multiverse
, restricted
are different components of the Sections
portion in a sources.list
entry and can not be duplicated for a given entry (same Type
(e.g. deb
), URI
(e.g. http://archive.ubuntu.com/ubuntu/
) , Suite
(e.g. xenial
)).
In your /etc/apt/sources.list
, you have duplicate components (main
, restricted
, universe
) in lines 2 and 5:
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
As line 5 is a superset of line 2, you can remove line 2 using your favorite editor or use sed
:
sudo sed -i '2d' /etc/apt/sources.list
Or comment out the 2nd line:
sudo sed -i '2 s/^/# /' /etc/apt/sources.list
Solution 2
Reset your repositories like this
sudo rm /etc/apt/sources.list
sudo software-properties-gtk
- Pick your options
- Save
Solution 3
I have this problem too,I fix it through the error message:
"W: Target Packages (main/binary-amd64/Packages) is configured multiple
times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5".
you can sudo vim /etc/apt/sources.list
.
then locate the second line, use # comment out the line.
save the file, and sudo apt-get update
,the problem will be solved.
Solution 4
This is issue with Ubuntu 16.04
You can fix it with xenial-backports
sudo apt install appstream/xenial-backports
sudo appstreamcli refresh --force
After the second command you will get
AppStream cache update completed successfully.
Related videos on Youtube
ThonkDifferent
Updated on September 18, 2022Comments
-
ThonkDifferent 3 months
I have Ubuntu 16.04 Xenial Xerus and when I want to run
sudo apt-get update
orsudo apt-get autoclean
orsudo apt-get install (package name)
orsudo apt-get install -f
, I get the following messages:Citire liste de pachete... 0% Citire liste de pachete... Terminat Se construiește arborele de dependență Se citesc informațiile de stare... Terminat W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Translations (main/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Translations (main/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Translations (restricted/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Translations (restricted/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Translations (universe/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Translations (universe/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target DEP-11 (universe/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target DEP-11-icons (universe/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5 W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Translations (main/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Translations (main/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Translations (restricted/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Translations (restricted/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Translations (universe/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Translations (universe/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target DEP-11 (universe/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8 W: Target DEP-11-icons (universe/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8
And this is my
/etc/apt/sources.list
:-
Admin about 6 yearsWelcome to Ask Ubuntu! Please consider providing text outputs instead of screenshots. It helps finding the question and improves formatting. Thanks
-
-
Jacques MALAPRADE almost 5 yearsNot working for me on 16.04.
-
EsmaeelE over 4 yearsIt's works for me in same issue on installing signal messenger under ubuntu 16.04LTS
-
Mark Carpenter Jr almost 4 yearsWill this remove ppa's?
-
Andrew almost 4 years@MarkCarpenterJr Yes, if it is in that file. No, if it is a separate file in the directory
/etc/apt/sources.list.d/
. A more thorough version of my answer would be to delete the files in the directory/etc/apt/sources.list.d/
-
goonerify over 1 yearBe aware that this will delete all your repos and you might not be able to install packages with
apt
anymore until you add a new sources.list file