有一段时间我一直遇到这个问题,但我不太确定在 /etc/apt/sources.list 中要修改什么。
这是我的 sources.list 文件:
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
#
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.digitalocean.com/ubuntu trusty main
deb-src http://mirrors.digitalocean.com/ubuntu trusty main
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.digitalocean.com/ubuntu trusty-updates main
deb-src http://mirrors.digitalocean.com/ubuntu trusty-updates main
## 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://mirrors.digitalocean.com/ubuntu trusty universe
deb-src http://mirrors.digitalocean.com/ubuntu trusty universe
"/etc/apt/sources.list" 62L, 3357C 1,1 Top
▽
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
#
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.digitalocean.com/ubuntu trusty main
deb-src http://mirrors.digitalocean.com/ubuntu trusty main
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.digitalocean.com/ubuntu trusty-updates main
deb-src http://mirrors.digitalocean.com/ubuntu trusty-updates main
## 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://mirrors.digitalocean.com/ubuntu trusty universe
deb-src http://mirrors.digitalocean.com/ubuntu trusty universe
"/etc/apt/sources.list" 62L, 3357C 1,1 Top
▽
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
#
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.digitalocean.com/ubuntu trusty main
deb-src http://mirrors.digitalocean.com/ubuntu trusty main
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.digitalocean.com/ubuntu trusty-updates main
deb-src http://mirrors.digitalocean.com/ubuntu trusty-updates main
## 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://mirrors.digitalocean.com/ubuntu trusty universe
deb-src http://mirrors.digitalocean.com/ubuntu trusty universe
"/etc/apt/sources.list" 62L, 3357C 1,1 Top
## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
## or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl
#
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.digitalocean.com/ubuntu trusty main
deb-src http://mirrors.digitalocean.com/ubuntu trusty main
## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.digitalocean.com/ubuntu trusty-updates main
deb-src http://mirrors.digitalocean.com/ubuntu trusty-updates main
## 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://mirrors.digitalocean.com/ubuntu trusty universe
deb-src http://mirrors.digitalocean.com/ubuntu trusty universe
"/etc/apt/sources.list" 62L, 3357C 1,1 Top
这是我尝试运行时的输出sudo apt-get update
。有很多重复的 sources.list 条目。
Get:1 http://repo.ajenti.org main InRelease [11.7 kB]
Get:2 http://repo.ajenti.org main/main amd64 Packages [6,755 B]
Get:3 http://repo.ajenti.org main/ubuntu amd64 Packages [4,110 B]
Get:4 http://repo.ajenti.org main/main i386 Packages [6,757 B]
Get:5 http://repo.ajenti.org main/ubuntu i386 Packages [4,110 B]
Get:6 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
Ign http://mirrors.digitalocean.com trusty InRelease
Get:7 http://mirrors.digitalocean.com trusty-updates InRelease [65.9 kB]
Get:8 http://mirrors.digitalocean.com trusty Release.gpg [933 B]
Get:9 http://security.ubuntu.com trusty-security/main Sources [119 kB]
Get:10 http://mirrors.digitalocean.com trusty-updates/main Sources [380 kB]
Get:11 http://mirrors.digitalocean.com trusty-updates/universe Sources [162 kB]
Get:12 http://security.ubuntu.com trusty-security/universe Sources [40.3 kB]
Get:13 http://mirrors.digitalocean.com trusty-updates/main amd64 Packages [889 kB]
Get:14 http://security.ubuntu.com trusty-security/main amd64 Packages [523 kB]
Get:15 http://mirrors.digitalocean.com trusty-updates/universe amd64 Packages [372 kB]
Get:16 http://mirrors.digitalocean.com trusty-updates/main i386 Packages [851 kB]
Get:17 http://mirrors.digitalocean.com trusty-updates/universe i386 Packages [373 kB]
Get:18 http://security.ubuntu.com trusty-security/universe amd64 Packages [135 kB]
Get:19 http://mirrors.digitalocean.com trusty-updates/main Translation-en [430 kB]
Get:20 http://security.ubuntu.com trusty-security/main i386 Packages [487 kB]
Get:21 http://mirrors.digitalocean.com trusty-updates/universe Translation-en [197 kB]
Get:22 http://security.ubuntu.com trusty-security/universe i386 Packages [135 kB]
Get:23 http://mirrors.digitalocean.com trusty Release [58.5 kB]
Get:24 http://security.ubuntu.com trusty-security/main Translation-en [287 kB]
Get:25 http://security.ubuntu.com trusty-security/universe Translation-en [80.8 kB]
Get:26 http://mirrors.digitalocean.com trusty/main Sources [1,064 kB]
Get:27 http://mirrors.digitalocean.com trusty/universe Sources [6,399 kB]
Get:28 http://mirrors.digitalocean.com trusty/main amd64 Packages [1,350 kB]
Get:29 http://mirrors.digitalocean.com trusty/universe amd64 Packages [5,859 kB]
Get:30 http://mirrors.digitalocean.com trusty/main i386 Packages [1,348 kB]
Get:31 http://mirrors.digitalocean.com trusty/universe i386 Packages [5,866 kB]
Get:32 http://mirrors.digitalocean.com trusty/main Translation-en [762 kB]
Get:33 http://mirrors.digitalocean.com trusty/universe Translation-en [4,089 kB]
Ign http://mirrors.digitalocean.com trusty/main Translation-en_US
Ign http://mirrors.digitalocean.com trusty/universe Translation-en_US
Ign http://repo.ajenti.org main/main Translation-en_US
Ign http://repo.ajenti.org main/main Translation-en
Ign http://repo.ajenti.org main/ubuntu Translation-en_US
Ign http://repo.ajenti.org main/ubuntu Translation-en
Fetched 32.4 MB in 24s (1,318 kB/s)
Duplicate sources.list entry http://repo.ajenti.org/ng/debian/ main/main amd64 Packages (/var/lib/apt/lists/repo.ajenti.org_ng_debian_dists_main_main_binary-amd64_Packages)
Duplicate sources.list entry http://repo.ajenti.org/ng/debian/ main/ubuntu amd64 Packages (/var/lib/apt/lists/repo.ajenti.org_ng_debian_dists_main_ubuntu_binary-amd64_Packages)
Duplicate sources.list entry http://repo.ajenti.org/ng/debian/ main/main i386 Packages (/var/lib/apt/lists/repo.ajenti.org_ng_debian_dists_main_main_binary-i386_Packages)
Duplicate sources.list entry http://repo.ajenti.org/ng/debian/ main/ubuntu i386 Packages (/var/lib/apt/lists/repo.ajenti.org_ng_debian_dists_main_ubuntu_binary-i386_Packages)
You may want to run apt-get update to correct these problems
Reading package lists... Done
W: Duplicate sources.list entry http://repo.ajenti.org/ng/debian/ main/main amd64 Packages (/var/lib/apt/lists/repo.ajenti.org_ng_debian_dists_main_main_binary-amd64_Packages)
W: Duplicate sources.list entry http://repo.ajenti.org/ng/debian/ main/ubuntu amd64 Packages (/var/lib/apt/lists/repo.ajenti.org_ng_debian_dists_main_ubuntu_binary-amd64_Packages)
W: Duplicate sources.list entry http://repo.ajenti.org/ng/debian/ main/main i386 Packages (/var/lib/apt/lists/repo.ajenti.org_ng_debian_dists_main_main_binary-i386_Packages)
W: Duplicate sources.list entry http://repo.ajenti.org/ng/debian/ main/ubuntu i386 Packages (/var/lib/apt/lists/repo.ajenti.org_ng_debian_dists_main_ubuntu_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems
希望你能帮助我。我绝对不是 Linux 方面的佼佼者,所以我对如何修改源代码感到困惑。
编辑:
命令 grep ajenti /etc/apt/ -R 给我这个:
/etc/apt/sources.list:deb http://repo.ajenti.org/ng/debian main main ubuntu
/etc/apt/sources.list:deb http://repo.ajenti.org/ng/debian main main ubuntu
Binary file /etc/apt/trusted.gpg matches
/etc/apt/sources_backup.list:deb http://repo.ajenti.org/ng/debian main main ubuntu
/etc/apt/sources_backup.list:deb http://repo.ajenti.org/ng/debian main main ubuntu