How to fix W: Target Packages (main/binary-amd64/Packages) is configured multiple times in APT

APTBEGINNERLOWUpdated Dec 29, 2025· 384 views

This warning appears when a repository is listed multiple times in your apt sources configuration. While not an error that prevents apt from working, having duplicate repository entries causes apt to download the same packages redundantly. Fix this by identifying and removing duplicate sources from your /etc/apt/sources.list and /etc/apt/sources.list.d/ files.

Quick fix

Fixes W: Target Packages (main/binary-amd64/Packages) is configured multiple times

W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:12 and /etc/apt/sources.list.d/ubuntu.sources:3
  1. Read the warning message carefully
  2. Check for duplicates in different files
  3. Remove duplicates from /etc/apt/sources.list.d/ files
  4. Remove duplicates within /etc/apt/sources.list
apt — error
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:12 and /etc/apt/sources.list.d/ubuntu.sources:3
W: Target Packages (main/binary-amd64/Packages) is configured multiple times

What this error means

APT uses configuration files to define which repositories to fetch packages from. When a repository is defined in multiple places—either in the same file with identical lines or in different source list files—apt detects this redundancy and issues a warning. This typically happens with entries like "main/binary-amd64/Packages" which indicates the main repository for 64-bit packages. The warning is not harmful to functionality; your system will still work and download packages correctly. However, duplicates waste bandwidth by checking the same repository multiple times and indicate leftover or conflicting configuration entries that should be cleaned up. APT expects each repository to be configured exactly once.

Typical symptoms

  • Warning message appears during apt update: "W: Target Packages is configured multiple times"
  • Warning lists specific file names and line numbers where duplicates exist
  • apt update and apt install still work despite the warning
  • Warning mentions different files in /etc/apt/sources.list.d/ or the main sources.list
  • Multiple .list files in /etc/apt/sources.list.d/ contain identical repository entries

Common causes

  1. Same repository added to both /etc/apt/sources.list and /etc/apt/sources.list.d/*.list files
  2. Manual edits added duplicate lines in the same sources.list file
  3. Installation scripts or third-party software added repositories without checking for existing entries
  4. Multiple .list files in /etc/apt/sources.list.d/ have the same repository definition
  5. Cloud-init or provisioning tools automatically added sources that were already manually configured
  6. Migration from /etc/apt/sources.list to /etc/apt/sources.list.d/ left entries in both places

How to fix "W: Target Packages (main/binary-amd64/Packages) is configured multiple times"

1Read the warning message carefully

When you run apt update, the warning will tell you exactly which files have duplicate entries. For example:

bash
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:12 and /etc/apt/sources.list.d/ubuntu.sources:3

Or for duplicates within the same file:

bash
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:12 and /etc/apt/sources.list:25

Note the file paths and line numbers mentioned. This tells you exactly where to find and fix the duplicates.

2Check for duplicates in different files

List the contents of your source files to identify duplicates:

bash
# View main sources file
cat /etc/apt/sources.list

# View all source files in sources.list.d
ls -la /etc/apt/sources.list.d/

# View contents of individual .list or .sources files
cat /etc/apt/sources.list.d/ubuntu.sources

Look for identical repository entries. For example, if you see:
- /etc/apt/sources.list contains: deb http://archive.ubuntu.com/ubuntu jammy main
- /etc/apt/sources.list.d/ubuntu.sources contains: deb http://archive.ubuntu.com/ubuntu jammy main

Then you have a duplicate that needs to be removed.

3Remove duplicates from /etc/apt/sources.list.d/ files

If duplicates exist in separate files under /etc/apt/sources.list.d/, the easiest solution is to delete the unnecessary .list file:

bash
# First, backup the file in case you need it
sudo cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak

# Delete the duplicate file
sudo rm /etc/apt/sources.list.d/ubuntu.sources

NOTE: Do not delete files in /etc/apt/sources.list.d/ unless you are certain they are truly duplicates of entries elsewhere. Ubuntu systems typically prefer to keep repository definitions in /etc/apt/sources.list (the main file) and not in separate .list files in the directory.

For multiple .list files with the same repository, keep the one you recognize or the one most recently created, and delete the others.

4Remove duplicates within /etc/apt/sources.list

If the warning shows duplicates on different lines of the same /etc/apt/sources.list file:

bash
# First, backup the file
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

# Edit the file
sudo nano /etc/apt/sources.list

Find the duplicate lines mentioned in the warning and:
- Delete one of the duplicate lines completely, OR
- Comment out the duplicate by adding # at the beginning

For example, if lines 12 and 25 are identical:

bash
# Line 12 (keep this one)
deb http://archive.ubuntu.com/ubuntu jammy main

# ... other lines ...

# Line 25 (comment this out or delete)
# deb http://archive.ubuntu.com/ubuntu jammy main

After editing, save the file (Ctrl+O, Enter, Ctrl+X in nano).

5Verify no duplicates remain

After removing or commenting out duplicates, run apt update to check if the warnings are gone:

bash
sudo apt update

If the warnings about target packages being configured multiple times no longer appear, you have successfully removed the duplicates. You should see output like:

bash
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease []
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease []
...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

Without any "W: Target Packages is configured multiple times" warnings.

6Use automated cleanup tool (optional)

If you have many duplicate entries and prefer automated removal, you can use the aptsources-cleanup tool:

bash
# Install required dependencies
sudo apt install python3-apt python3-regex

# Download and run the cleanup script
wget https://git.launchpad.net/~foersteri/+junk/apt-remove-duplicate-source-entries/+archive/branch/master/+files/apt-remove-duplicate-source-entries.pyz
python3 apt-remove-duplicate-source-entries.pyz

The script will:
1. Detect duplicate entries in your sources configuration
2. Show you which duplicates were found
3. Ask for confirmation before removing them
4. Deactivate duplicate entries (by commenting them out)

This approach is safer as it backs up your configuration before making changes. However, manual removal as described above is often faster for most systems.

Advanced notes

On modern Ubuntu systems (20.04+), repositories are increasingly managed through /etc/apt/sources.list.d/ with individual .sources files using DEB822 format instead of the traditional one-liner format in /etc/apt/sources.list. If you have both formats, ensure you do not duplicate entries across them. Cloud-init (used in cloud VMs and containers) automatically generates /etc/apt/sources.list.d/ubuntu.sources on first boot, which can conflict with manually configured entries in /etc/apt/sources.list. If you see this warning after provisioning, check whether cloud-init created duplicate entries. Proxmox and other systems may also auto-generate sources entries. For CI/CD pipelines or Docker containers, prevent this by either: (1) deleting /etc/apt/sources.list.d/ubuntu.sources after the base image setup, or (2) managing all sources through a single file and deleting others. The warning does not affect package installation, caching, or security; it is purely informational. However, having duplicates does slightly increase apt database size and causes apt to redundantly check the same repository, wasting minimal bandwidth during updates.

Frequently asked questions

What does "W: Target Packages (main/binary-amd64/Packages) is configured multiple" mean?
APT uses configuration files to define which repositories to fetch packages from. When a repository is defined in multiple places—either in the same file with identical lines or in different source list files—apt detects this redundancy and issues a warning. This typically happens with entries like "main/binary-amd64/Packages" which indicates the main repository for 64-bit packages.
How do I fix "W: Target Packages (main/binary-amd64/Packages) is configured multiple"?
This warning appears when a repository is listed multiple times in your apt sources configuration. While not an error that prevents apt from working, having duplicate repository entries causes apt to download the same packages redundantly. Fix this by identifying and removing duplicate sources from your /etc/apt/sources.list and /etc/apt/sources.list.d/ files.
What causes "W: Target Packages (main/binary-amd64/Packages) is configured multiple"?
Same repository added to both /etc/apt/sources.list and /etc/apt/sources.list.d/*.list files Manual edits added duplicate lines in the same sources.list file Installation scripts or third-party software added repositories without checking for existing entries
Is the "W: Target Packages (main/binary-amd64/Packages) is configured multiple" error serious?
It is a low-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading