当我尝试升级到 16.04 时,系统提示我系统上有“不稳定的软件包”,需要修复。每次运行更新时,我都会收到以下信息:
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target DEP-11 (multiverse/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target DEP-11-icons (multiverse/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target Translations (universe/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target DEP-11 (universe/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target DEP-11-icons (universe/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target DEP-11 (multiverse/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target DEP-11-icons (multiverse/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:27 and /etc/apt/sources.list:54
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target DEP-11 (restricted/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target DEP-11-icons (restricted/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:6 and /etc/apt/sources.list:54
W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target Translations (universe/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target DEP-11 (universe/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
W: Target DEP-11-icons (universe/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:17 and /etc/apt/sources.list:54
当我跑步时cat -n /etc/apt/sources.list
,我得到了:
1 # deb cdrom:[Ubuntu 15.10 _Wily Werewolf_ - Release amd64 (20151021)]/ wily main restricted
2 # deb cdrom:[Ubuntu 14.04.1 LTS _Trusty Tahr_ - Release amd64 (20140722.2)]/ trusty main restricted
3
4 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
5 # newer versions of the distribution.
6 deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
7 deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
8
9 ## Major bug fix updates produced after the final release of the
10 ## distribution.
11 deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
12 deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
13
14 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
15 ## team. Also, please note that software in universe WILL NOT receive any
16 ## review or updates from the Ubuntu security team.
17 deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
18 deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
19 deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
20 deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
21
22 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
23 ## team, and may not be under a free licence. Please satisfy yourself as to
24 ## your rights to use the software. Also, please note that software in
25 ## multiverse WILL NOT receive any review or updates from the Ubuntu
26 ## security team.
27 deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
28 deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
29 deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
30 deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
31
32 ## N.B. software from this repository may not have been tested as
33 ## extensively as that contained in the main release, although it includes
34 ## newer versions of some applications which may provide useful features.
35 ## Also, please note that software in backports WILL NOT receive any review
36 ## or updates from the Ubuntu security team.
37 deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
38 deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
39
40 deb http://security.ubuntu.com/ubuntu xenial-security main restricted
41 deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
42 deb http://security.ubuntu.com/ubuntu xenial-security universe
43 deb-src http://security.ubuntu.com/ubuntu xenial-security universe
44 deb http://security.ubuntu.com/ubuntu xenial-security multiverse
45 deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
46
47 ## Uncomment the following two lines to add software from Canonical's
48 ## 'partner' repository.
49 ## This software is not part of Ubuntu, but is offered by Canonical and the
50 ## respective vendors as a service to Ubuntu users.
51 # deb http://archive.canonical.com/ubuntu trusty partner
52 # deb-src http://archive.canonical.com/ubuntu trusty partner
53
54 deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse main restricted universe
55
56 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
57 # newer versions of the distribution.
58
59 ## Major bug fix updates produced after the final release of the
60 ## distribution.
61
62 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
63 ## team. Also, please note that software in universe WILL NOT receive any
64 ## review or updates from the Ubuntu security team.
65
66 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
67 ## team, and may not be under a free licence. Please satisfy yourself as to
68 ## your rights to use the software. Also, please note that software in
69 ## multiverse WILL NOT receive any review or updates from the Ubuntu
70 ## security team.
71
72 ## N.B. software from this repository may not have been tested as
73 ## extensively as that contained in the main release, although it includes
74 ## newer versions of some applications which may provide useful features.
75 ## Also, please note that software in backports WILL NOT receive any review
76 ## or updates from the Ubuntu security team.
77
78
79 ## Uncomment the following two lines to add software from Canonical's
80 ## 'partner' repository.
81 ## This software is not part of Ubuntu, but is offered by Canonical and the
82 ## respective vendors as a service to Ubuntu users.
83 # deb http://archive.canonical.com/ubuntu wily partner
84 # deb-src http://archive.canonical.com/ubuntu wily partner
85 deb http://us.archive.ubuntu.com/ubuntu/ xenial-proposed main universe restricted multiverse
答案1
为了轻松修复您的sources.list
文件,您可以复制以下块并在切换到 root 后将其粘贴到您的终端中sudo su
(粘贴后您需要点击return一次才能恢复为普通用户):
cp /etc/apt/sources.list /etc/apt/sources.list.repairbackup
cat > /etc/apt/sources.list << EOF
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
EOF
exit
笔记:这将以正确的方式启用所有主存储库,如果您想对其进行更改,您可以编辑它或使用 GUI 工具。sources.list
您可以在 下找到您的旧问题/etc/apt/sources.list.repairbackup
。