最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决(fixed)】W: Duplicate sources.list entry when do “sudo apt-get update”

Ubuntu crifan 6213浏览 0评论

【问题】
在执行sudo apt-get update 之后,出现错误:
。。。
正在读取软件包列表… 完成
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic/main Packages (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic_main_binary-i386_Packages)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic/main Translation-zh_CN (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic_main_i18n_Translation-zh%5fCN)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic/restricted Packages (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic_restricted_binary-i386_Packages)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic/restricted Translation-zh_CN (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic_restricted_i18n_Translation-zh%5fCN)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic/universe Packages (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic_universe_binary-i386_Packages)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic/universe Translation-zh_CN (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic_universe_i18n_Translation-zh%5fCN)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic/multiverse Packages (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic_multiverse_binary-i386_Packages)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic/multiverse Translation-zh_CN (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic_multiverse_i18n_Translation-zh%5fCN)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic-updates/main Packages (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic-updates_main_binary-i386_Packages)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic-updates/restricted Packages (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic-updates_restricted_binary-i386_Packages)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic-updates/universe Packages (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic-updates_universe_binary-i386_Packages)
W: Duplicate sources.list entry http://cn.archive.ubuntu.com karmic-updates/multiverse Packages (/var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_karmic-updates_multiverse_binary-i386_Packages)
W: 您可能需要运行 apt-get update 来解决这些问题

【解决过程】

提示:

对于连sources.list文件都不知道是啥的人,请先去看这个:

APT HOWTO (Obsolete Documentation) 第 2 章 – 基础设置

去打开apt的源:
sudo gedit /etc/apt/sources.list

发现了如下内容(found that):

# Mirrors.shlug.org更新服务器
#(电信服务器,Ubuntu China Official Mirror, maintained by Shanghai Linux User Group)
# ~20KB
deb http://cn.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse

# Mirror.lupaworld.com更新服务器(浙江省杭州市双线服务器)
# !!! ~230KB/s
deb http://mirror.lupaworld.com/ubuntu karmic main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-proposed main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-proposed main restricted universe multiverse

其中“ # Mirrors.shlug.org更新服务器”的部分,没有按照预料的那样被注释掉

(the # Mirrors.shlug.org更新服务器 part, is not comment out as expected, so it is duplicated with the orignal default ones):

deb http://cn.archive.ubuntu.com/ubuntu/ karmic main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ karmic-updates main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ karmic universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic universe
deb http://cn.archive.ubuntu.com/ubuntu/ karmic-updates universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

所以,解决方法很简单,那就是:

注释(或直接删除)掉/etc/apt/sources.list中,内容有重复的那部分,就可以避免此错误了。

(so the solution is quite simple:
comment out or remove the duplicated source in your /etc/apt/sources.list

)

just :
sudo gedit /etc/apt/sources.list
then do like this :
# Mirrors.shlug.org更新服务器
#(电信服务器,Ubuntu China Official Mirror, maintained by Shanghai Linux User Group)
# ~20KB
#deb http://cn.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
#deb http://cn.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
#deb http://cn.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
#deb http://cn.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
#deb http://cn.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
#deb-src http://cn.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
#deb-src http://cn.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
#deb-src http://cn.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
#deb-src http://cn.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
#deb-src http://cn.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse

转载请注明:在路上 » 【已解决(fixed)】W: Duplicate sources.list entry when do “sudo apt-get update”

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (4)

  1. 谢谢大佬,好人一生平安。
    微风7年前 (2017-08-06)回复
  2. 我没看懂你说的是什么意思,但是咱俩遇到的情况是一个样子的。
    韩小曼13年前 (2012-06-19)回复
    • 已添加中文的解释。这样应该可以看懂了吧?
      crifan13年前 (2012-06-19)回复
  3. 谢谢你,解决了我的问题
    爱早起13年前 (2012-05-28)回复
89 queries in 0.200 seconds, using 22.47MB memory