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

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

Reset your repositories like this

  1. sudo rm /etc/apt/sources.list
  2. sudo software-properties-gtk
  3. Pick your options
  4. Save

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.

Tags:

Apt