我有 Ubuntu 16.04 Xenial 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... 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
这是我的/etc/apt/sources.list
:
答案1
main
、、、是条目中部分的不同组成部分,对于给定universe
的条目不能重复(相同(例如)、(例如)、(例如))。multiverse
restricted
Sections
sources.list
Type
deb
URI
http://archive.ubuntu.com/ubuntu/
Suite
xenial
在您的 中,第 2 行和第 5 行/etc/apt/sources.list
有重复的组件(main
,restricted
, ):universe
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
由于第 5 行是第 2 行的超集,因此您可以使用自己喜欢的编辑器删除第 2 行,或者使用sed
:
sudo sed -i '2d' /etc/apt/sources.list
或者注释掉第二行:
sudo sed -i '2 s/^/# /' /etc/apt/sources.list
答案2
谨防:这将删除您的所有存储库,并且您可能无法再使用 apt 安装软件包,直到您添加新的 sources.list 文件。
重置你的存储库像这样
sudo rm /etc/apt/sources.list
sudo software-properties-gtk
- 选择你的选项
- 节省
答案3
我也遇到了这个问题,我通过错误信息修复了它:
"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
问题就解决了。
答案4
这是 Ubuntu 16.04 的问题
你可以用以下方法修复它xenial-backports
sudo apt install appstream/xenial-backports
sudo appstreamcli refresh --force
执行第二条命令后你将得到
AppStream cache update completed successfully.