Как исправить ошибку W: Целевые пакеты (main/binary-amd64/Packages) настраиваются несколько раз в моих источниках.файл списка?

У меня есть Ubuntu 16.04 и Xerus, и когда я хочу запустить sudo apt-get update или sudo apt-get autoclean или sudo apt-get install (package name) или sudo apt-get install -f, я получаю следующие сообщения:

Citire liste de pachete... 0%Citire liste de pachete... TerminatSe construiește arborele de dependență       Se citesc informațiile de stare... TerminatW: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Translations (main/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Translations (main/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Translations (restricted/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Translations (restricted/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Translations (universe/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Translations (universe/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target DEP-11 (universe/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target DEP-11-icons (universe/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Translations (main/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Translations (main/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Translations (restricted/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Translations (restricted/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Translations (universe/i18n/Translation-ro_RO) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Translations (universe/i18n/Translation-ro) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: Target DEP-11 (universe/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:4 and /etc/apt/sources.list:8W: 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

И это мой /etc/apt/sources.list:

/etc/apt/sources.list

main, universe, multiverse, restricted являются различными компонентами Sections часть в sources.list запись и не может быть продублирована для данной записи (та же Type (например deb), URI (например http://archive.ubuntu.com/ubuntu/) , Suite (например xenial)).

В вашем /etc/apt/sources.list, у вас есть дублирующиеся компоненты (main, restricted, universe) в строках 2 и 5:

deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universedeb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse

Поскольку строка 5 является надстрокой строки 2, вы можете удалить строку 2 с помощью вашего любимого редактора или использовать sed:

sudo sed -i '2d' /etc/apt/sources.list

Или закомментируйте 2-ю строку:

sudo sed -i '2 s/^/# /' /etc/apt/sources.list

Сбросьте настройки ваших репозиториев подобный этому

  1. sudo rm /etc/apt/sources.list
  2. sudo software-properties-gtk
  3. Выберите свои варианты
  4. Сохранить

Это проблема с Ubuntu 16.04

Вы можете исправить это с помощью xenial-backports

sudo apt install appstream/xenial-backportssudo appstreamcli refresh --force

После второй команды вы получите

AppStream cache update completed successfully.

У меня тоже есть эта проблема, я исправляю ее с помощью сообщения об ошибке:

"W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:2 and /etc/apt/sources.list:5".

ты можешь sudo vim /etc/apt/sources.list.

затем найдите вторую строку, используйте # закомментируйте строку.

сохраните файл и sudo apt-get update, проблема будет решена.

Добро пожаловать в Ask Ubuntu! Пожалуйста, рассмотрите возможность предоставления текстовых выходных данных вместо скриншотов. Это помогает найти вопрос и улучшает форматирование. Спасибо