How to Fix ‘Target Packages Is Configured Multiple Times’ in Ubuntu

Running sudo apt update on an Ubuntu desktop or server only to see the terminal output peppered with yellow warnings such as “W: Target Packages … is configured multiple times in /etc/apt/sources.list:XX and /etc/apt/sources.list.d/XX.list” indicates that your Advanced Package Tool (APT) configuration contains redundant repository entries. While this warning does not completely prevent packages from updating, it slows down repository synchronisation, causes duplicate network queries, and can introduce version conflicts when software repositories change keys.

Analyse the APT Warning to Locate Duplicate Entries

The warning message emitted by APT provides the exact file paths and line numbers where the duplicate repository definitions reside.

  1. Open a Terminal window (press Ctrl + Alt + T).
  2. Run sudo apt update and carefully read the warning lines displayed at the conclusion of the update process.
  3. Notice the two referenced file paths in the warning. For example:
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:24 and /etc/apt/sources.list.d/google-chrome.list:1
  4. This indicates that the exact same repository URL is defined on line 24 of /etc/apt/sources.list and also on line 1 of /etc/apt/sources.list.d/google-chrome.list.

Edit and Remove Redundant Lines in sources.list

If the duplicate repository is defined both in the primary sources file and a standalone list file, comment out or delete the entry from the primary file.

  1. Open the main repository configuration file in a terminal editor:
    sudo nano /etc/apt/sources.list
  2. Press Ctrl + _ (Ctrl + underscore) in Nano, type the line number mentioned in the warning (e.g. 24), and press Enter to jump directly to that line.
  3. Examine the line. To disable it without deleting, place a hash symbol (#) at the very start of the line:
    # deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
  4. Press Ctrl + O followed by Enter to save the file, then Ctrl + X to exit the editor.
  5. Run sudo apt update to verify that the specific warning disappears.

Remove Duplicate Files in sources.list.d

Third-party installers (such as Chrome, VS Code, or Docker) frequently generate a fresh .list file during package installation, creating duplicates if a repository was already configured manually.

  1. Navigate to the sources directory:
    cd /etc/apt/sources.list.d/
  2. List all list files:
    ls -la
  3. Look for redundant files (for example, having both vscode.list and microsoft-vscode.list pointing to the same Microsoft repository).
  4. Inspect the contents of suspect files:
    cat <filename>.list
  5. Safely remove the redundant list file:
    sudo rm <redundant-filename>.list

Check for Modern DEB822 .sources Duplicates in Ubuntu 24.04 LTS

Ubuntu 24.04 LTS transitions from traditional one-line .list files to multi-line DEB822 formatted ubuntu.sources files.

  1. If the warning references /etc/apt/sources.list.d/ubuntu.sources, open the file:
    sudo nano /etc/apt/sources.list.d/ubuntu.sources
  2. Check if older legacy entries were also left inside /etc/apt/sources.list.
  3. If /etc/apt/sources.list still contains active deb http://archive.ubuntu.com/ubuntu... entries, clear or backup that file, as ubuntu.sources now serves as the authoritative system repository source.
  4. Save changes and exit.

Execute a Clean APT Update Verification

Once all duplicate definitions have been harmonised, run a final validation cycle.

  1. Run:
    sudo apt update
  2. Ensure the process terminates with “All packages are up to date” or a standard list of upgradable packages without any “W: Target Packages … is configured multiple times” lines.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.