Debian、Ubuntu 源列表说明(2015-08-26 更新)

新手涉及到的教学或入门贴,推荐新手必看,版主维护
头像
自由建客
帖子: 13468
注册时间: 2008-07-30 23:21
系统: Debian stable AMD64

Debian、Ubuntu 源列表说明(2015-08-26 更新)

#1

帖子 自由建客 » 2012-03-07 19:45

概貌:
源列表主文件 /etc/apt/sources.list,兼取 /etc/apt/sources.list.d/*,结果以并集论。
源列表文件以为单位,每行分多个字段,字段间以空白符分隔。井号(#)开头为注释行。


字段说明:

第一字段,指示包类型。
取值仅「deb」「deb-src」两个,分别对应二进制包和源码包。通常仅二进制包有用。

第二字段,指示镜像站点,即「源」!
URL 定位到某个目录,该目录下必有「dists」「pool」两个子目录。如:http://ftp.cn.debian.org/debian/http://ftp.sjtu.edu.cn/ubuntu/

第三字段,指示包的「版本类型」,姑且称为「仓库」。
打开某源,进入「dists」子目录可见该源中有哪些仓库,即其下诸子目录。
命名形式为「系统发行版名-仓库名」,如 Debian 的「jessie-backports」「stretch-updates」,Ubuntu 的「vivid-updates」「wily-proposed」。无仓库名的即为主仓库。
Debian 的 stable、testing 为链接,指向具体系统发行版,会随时间而变。比如,当前 stable 为 jessie,所以 stable-backports 与 jessie-backports 等效。但本人不建义使用 stable、testing,因为下一个 stable 发布后,你的源便自动指向了一个新版本,然而你并未阅读新版本的发行说明,并未做好升级的准备。
Debian 的仓库自 squeeze 起与 Ubuntu 基本相同。除主仓库外,有:
「security」,Ubuntu 用于指安全性更新。即影响系统安全的 bug 修补。Debian 特殊一些,见下文。
「updates」,非安全性更新。即不影响到系统安全的 bug 修补。
「proposed-updates」,预更新。小 beta 版。过后会进入「updates」或「security」。Ubuntu 仅用「proposed」,无后缀「updates」。
「backports」,后备。Debian stable 发布后,Ubuntu 某版本正式发布后,其所有软件版本号便已被冻结,所有软件只修 bug,不增加任何特性。但有人可能需要新特性,甚至某些较新的软件原来根本就没有。该仓库正因此而设,但欠官方维护,且可能在系统正式发布之后过一段时间才有内容。此仓库处于第二优先顺序,而上述几个仓库处于第一优先顺序。安装第二优先顺序的包必须特别指明,见 apt-get(8) aptitude(8) 的 --target-release 选项。
提示:并非所有版本都设有上述全部仓库,请打开源中 dists 目录查看。

后续字段,指示包许可类型。
后续字段排名不分先后,最终结果取其并集。
按包本身的许可及所直接依赖的包的许可划分。打开某仓库,可见几个子目录。
Debian 最多有三种
「main」,本身是自由软件,且所有依赖的包也都是自由软件,此类可称纯自由软件,见 https://www.debian.org/distrib/packages《Debian自由软件指导方针》。
「contrib」,本身是自由软件,但依赖不纯,即依赖中至少有一例 contrib 或 non-free 者。
「non-free」,本身并非自由软件,无论依赖如何。当然,该软件是可免费使用或试用的。免费一例 https://packages.debian.org/jessie/unrar,试用xx天一例 https://packages.debian.org/jessie/rar
Ubuntu 最多有四种
「main」,官方维护的自由软件。
「universe」,社区维护的自由软件。
「restricted」,设备专有驱动。
「multiverse」,同 Debian 的「non-free」。
某些另类的第三方源,未必遵循上述惯例。总之,打开仓库目录自己看。


特别之处:

Debian 安全性更新
不像 Ubuntu 放在「security」仓库,而是放在单独一个源中。各大镜像站通常都把一般的包放在根下来一级的「debian」目录中,而安全性更新则会放在「debian-security」目录中,如果有的话,如 http://ftp.cn.debian.org/debian-security/
Debian 官方建议,所有安全性更新,只从官方主站更新,勿使用其它镜像站,除非你对镜像站非常有信心,见 https://www.debian.org/security/index.en.html。所以,很多镜像站并不提供安全更新源。
安全性更新的第三字段形式固定为「版本名/updates」,如「wheezy/updates」「jessie/updates」。

Debian 多媒体源
一些多媒体软件因牵涉到版权问题,包括硬件解码器,Debian 官方并未收录,有一网站专门填补该空缺,见 http://www.deb-multimedia.org


最后忠告:
不要同时启用多个源,同一仓库的源启用一个即可,否则容易引起混乱。以下实例便是列有多套而仅启用一套。

实例:
Debian 8 jessie

代码: 全选

deb http://ftp.tw.debian.org/debian/ jessie main contrib non-free
deb http://ftp.tw.debian.org/debian/ jessie-updates main contrib non-free
deb http://ftp.tw.debian.org/debian/ jessie-backports main contrib non-free
deb http://security.debian.org/ jessie/updates main contrib non-free
deb http://ftp.yzu.edu.tw/Linux/debian-multimedia/ jessie main non-free

#deb http://ftp.cn.debian.org/debian/ jessie main contrib non-free
#deb http://ftp.cn.debian.org/debian/ jessie-updates main contrib non-free
#deb http://ftp.cn.debian.org/debian/ jessie-backports main contrib non-free
#deb http://ftp.cn.debian.org/debian-security/ jessie/updates main contrib non-free
#deb http://ftp.cn.debian.org/debian-multimedia/ jessie main non-free

#deb http://ftp.sjtu.edu.cn/debian/ jessie main contrib non-free
#deb http://ftp.sjtu.edu.cn/debian/ jessie-updates main contrib non-free
#deb http://ftp.sjtu.edu.cn/debian/ jessie-backports main contrib non-free
#deb http://ftp.sjtu.edu.cn/debian-security/ jessie/updates main contrib non-free
#deb http://ftp.cn.debian.org/debian-multimedia/ jessie main non-free

#deb http://ftp.debian.org/debian/ jessie main contrib non-free
#deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free
#deb http://ftp.debian.org/debian/ jessie-backports main contrib non-free
#deb http://security.debian.org/ jessie/updates main contrib non-free
#deb http://www.deb-multimedia.org/ jessie main non-free
Ubuntu 15.04 vivid

代码: 全选

deb http://mirrors.163.com/ubuntu/ vivid main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ vivid-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ vivid-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ vivid-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ vivid-backports main restricted universe multiverse

#deb http://mirrors.sohu.com/ubuntu/ vivid main restricted universe multiverse
#deb http://mirrors.sohu.com/ubuntu/ vivid-security main restricted universe multiverse
#deb http://mirrors.sohu.com/ubuntu/ vivid-updates main restricted universe multiverse
#deb http://mirrors.sohu.com/ubuntu/ vivid-proposed main restricted universe multiverse
#deb http://mirrors.sohu.com/ubuntu/ vivid-backports main restricted universe multiverse

#deb http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiverse
#deb http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiverse
#deb http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiverse
#deb http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiverse
#deb http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse

#deb http://archive.ubuntu.com/ubuntu/ vivid main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ vivid-security main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ vivid-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ vivid-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ vivid-backports main restricted universe multiverse
上次由 自由建客 在 2012-05-10 8:23,总共编辑 3 次。
头像
qy117121
论坛版主
帖子: 50528
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#2

帖子 qy117121 » 2012-03-07 19:46

学习了,还是用ubuntu
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用

邮箱 chuan@ubuntu.org.cn
头像
lovebluesky
帖子: 487
注册时间: 2010-02-03 17:09

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#3

帖子 lovebluesky » 2012-03-07 20:36

mark,喜欢debian,学习了
openSUSE+xfce 13年初开始用,可能要成为我用的最久的linux系统了
之所以xfce的官方理由是他轻便简洁
非官方理由是穷,没钱换高配电脑
继续为了买了mac但任性的换装openSUSE而奋斗!
头像
ever_fly
帖子: 10
注册时间: 2012-03-11 18:08

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#5

帖子 ever_fly » 2012-03-14 13:56

我不知道为什么我会出这样的错误,为什么dns默认把地址解析成ipv6的地址了?我查过hosts,没有debian的条目。我想问下你们访问http://ftp.cn.debian.org/是ipv6的地址吗?

代码: 全选

W: 无法下载 http://ftp.cn.debian.org/debian/dists/squeeze/updates/main/binary-i386/Packages.gz  404  Not Found [IP: 2001:da8:d800:95::110 80]

W: 无法下载 http://ftp.cn.debian.org/debian/dists/squeeze/updates/contrib/binary-i386/Packages.gz  404  Not Found [IP: 2001:da8:d800:95::110 80]

W: 无法下载 http://ftp.cn.debian.org/debian/dists/squeeze/updates/non-free/binary-i386/Packages.gz  404  Not Found [IP: 2001:da8:d800:95::110 80]

E: 有一些索引文件不能下载,它们可能被忽略了,也可能转而使用了旧的索引文件。
Guide me, in the dark.
头像
nmsfan
帖子: 18958
注册时间: 2009-10-16 22:46
来自: finland

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#6

帖子 nmsfan » 2012-03-14 18:26

ever_fly 写了:我不知道为什么我会出这样的错误,为什么dns默认把地址解析成ipv6的地址了?我查过hosts,没有debian的条目。我想问下你们访问http://ftp.cn.debian.org/是ipv6的地址吗?

代码: 全选

W: 无法下载 http://ftp.cn.debian.org/debian/dists/squeeze/updates/main/binary-i386/Packages.gz  404  Not Found [IP: 2001:da8:d800:95::110 80]

W: 无法下载 http://ftp.cn.debian.org/debian/dists/squeeze/updates/contrib/binary-i386/Packages.gz  404  Not Found [IP: 2001:da8:d800:95::110 80]

W: 无法下载 http://ftp.cn.debian.org/debian/dists/squeeze/updates/non-free/binary-i386/Packages.gz  404  Not Found [IP: 2001:da8:d800:95::110 80]

E: 有一些索引文件不能下载,它们可能被忽略了,也可能转而使用了旧的索引文件。
中科大服务器是双线吧,ipv4和ipv6都可以的。
你可以换个写法
http://hi.baidu.com/jhang20081616/blog/ ... 18e75.html
>>>>推Ubuntu 桌面培训~~<<<<
>>>>想加入/了解gimp汉化吗,点我吧~<<<<
——————————————————————
不推荐wubi,也不推荐你给别人推荐wubi…………
随心而为的感觉真好……
强推mayhem!!
强推ensiferum
头像
lwaterl
帖子: 379
注册时间: 2007-08-24 17:46

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#7

帖子 lwaterl » 2012-03-16 12:48

自由建客 写了: squeeze-updates,普通更新源,一级子目录 debian 中。以往病毒库等经常变动的数据由 debian-volatile 源提供。现在则将其再加上非安全性漏洞修补,一同合并到该源之中。
squeeze-proposed-updates,一级子目录 debian 中。该源比较特殊,它是作为正式进入普通更新源和安全更新源之前的再次测试,可算作是小 beta 版。以往该源是安全更新源的超集,但现在不是,进入安全更新的包会从该源中删除。所以现在,即便加了此源仍然要再加上安全更新源。我个人建议没必要加此源。
*-update是属于漏洞补丁包?
wheezy 没有wheezy-update,是不是最好加上wheezy-proposed-updates源呢?
头像
YeLee
论坛版主
帖子: 26406
注册时间: 2008-08-13 8:48
系统: Fundu i64
来自: 东海硇州,一双管钥。
联系:

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#8

帖子 YeLee » 2012-03-16 17:29

学习了 :em11 :em11 :em11
觉得package网站是个强大的东西。
◎当我站在道德的高度上俯视别人的时候,发现自己是多么渺小。
♥执着但不偏激,反对而不排斥,坚决捍卫矛盾体的存在方式。
★★★天气预报★★★
fcitx-yatable一个可以使用的码表输入法
[教程]几个实例攻克软件编译难关
Gentoo Development Guide
字体相关
头像
自由建客
帖子: 13468
注册时间: 2008-07-30 23:21
系统: Debian stable AMD64

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#9

帖子 自由建客 » 2012-03-16 19:19

lwaterl, wheezy 还在 testing 阶段,自然没有 wheezy-updates,更没有独立的安全更新。wheezy-proposed-updates 是小 beta 版,过后会直接并入 wheezy 主源,你想快点打补丁的就开启。
头像
lovebluesky
帖子: 487
注册时间: 2010-02-03 17:09

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#10

帖子 lovebluesky » 2012-03-16 20:42

上周正式转战debian,但是还是怀念gnome3,算了,忍了,等个猴年马月的升级成gnome3就好了
openSUSE+xfce 13年初开始用,可能要成为我用的最久的linux系统了
之所以xfce的官方理由是他轻便简洁
非官方理由是穷,没钱换高配电脑
继续为了买了mac但任性的换装openSUSE而奋斗!
头像
lwaterl
帖子: 379
注册时间: 2007-08-24 17:46

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#11

帖子 lwaterl » 2012-03-16 20:58

自由建客 写了:lwaterl, wheezy 还在 testing 阶段,自然没有 wheezy-updates,更没有独立的安全更新。wheezy-proposed-updates 是小 beta 版,过后会直接并入 wheezy 主源,你想快点打补丁的就开启。
这下明白了
头像
ffdqlff
帖子: 78
注册时间: 2011-01-27 16:36

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#12

帖子 ffdqlff » 2012-03-27 21:52

学习了 :em11 :em11
不是尤里·纳吉宾式的结局,而应该是欧·亨利式的结局!
头像
萧胤楼
帖子: 7
注册时间: 2012-04-09 9:57

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#13

帖子 萧胤楼 » 2012-05-03 9:23

为什么菜鸟看所有的一切都是那么的奥妙…… :em06
头像
自由建客
帖子: 13468
注册时间: 2008-07-30 23:21
系统: Debian stable AMD64

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#14

帖子 自由建客 » 2012-05-03 16:02

代码: 全选

受命于天 既寿永昌 顺我者生 逆我者亡
什么鸟字嘛!这写得,篆不篆,隶不隶的! :em04
头像
萧胤楼
帖子: 7
注册时间: 2012-04-09 9:57

Re: Debian 源列表说明(第二版)(2012-03-07 首发)

#15

帖子 萧胤楼 » 2012-05-04 8:36

自由建客 写了:

代码: 全选

受命于天 既寿永昌 顺我者生 逆我者亡
什么鸟字嘛!这写得,篆不篆,隶不隶的! :em04
哎哟,这你都认得出来,金文体,我很喜欢~ :em02
回复