How to fix error W: Target Packages (main/binary-amd64/Packages) is configured multiple times in my sources.list file?

apt
216,289

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

  1. sudo rm /etc/apt/sources.list
  2. sudo software-properties-gtk
  3. Pick your options
  4. 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.
Share:
216,289

Related videos on Youtube

Author by

ThonkDifferent

Updated on September 18, 2022

Comments

  • ThonkDifferent 3 months

    I have Ubuntu 16.04 Xenial Xerus and when I want to run sudo apt-get update or sudo apt-get autoclean or sudo apt-get install (package name) or sudo 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:

    /etc/apt/sources.list

    • Admin
      Admin about 6 years
      Welcome to Ask Ubuntu! Please consider providing text outputs instead of screenshots. It helps finding the question and improves formatting. Thanks
  • Jacques MALAPRADE
    Jacques MALAPRADE almost 5 years
    Not working for me on 16.04.
  • EsmaeelE
    EsmaeelE over 4 years
    It's works for me in same issue on installing signal messenger under ubuntu 16.04LTS
  • Mark Carpenter Jr
    Mark Carpenter Jr almost 4 years
    Will this remove ppa's?
  • Andrew
    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
    goonerify over 1 year
    Be 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