您的位置:首页 > 其它

Ubuntu、Debian更新源文件sources.list的书写格式

2009-12-25 16:19 567 查看

Ubuntu、Debian更新源文件sources.list的书写格式

http://blog.chinaunix.net/u1/41167/showart_2082239.html

注:使用非官方源需慎重,尤其是驱动部分的更新可能会导致登录X的问题,具体是xserver-xorg的更新可能会出现问题

普通升级用 apt-get upgrade , 发行版升级用 apt-get dist-upgrade

1、sources.list书写的方法
(1)地址:找到包含dists和pool这两个目录的地址,比如
http://mirrors.geekbone.org/debian/
(2)目录名:打开dists,里面包含的目录名字,记下来。比如dists/包含sarge、etch、woody、sid。
(3)名字:打开以上目录,看看里面包含哪些组件名字,比如main、cont
rib、non-free;
4)书写格式:deb <1记下来的地址> <2记下来的目录名> <3记下来的名字>,如:
deb ftp://ftp.linuxforum.net/debian/ sarge main contrib non-free
发现一个比较快的台湾地址: http://ftp.isu.edu.tw/pub/Linux/Debian/debian/
书写了一下:deb http://ftp.isu.edu.tw/pub/Linux/Debian/debian/ sarge main contrib non-free
2、国内安装源:
deb http://mirror.geekbone.org/debian woody mian contrib non-free, 升级前,修改/etc/apt/souces.list的内容如下:
deb http://mirror.geekbone.org/debian sarge main contrib non-free
3、常用安装源
安全更新,安装的时候可以选择,不用自己加。
deb http://security.debian.org/ sarge/updates main contrib non-free
比较快的Asia安装源
deb http://mirror.vmmatrix.net/debian/ testing main
deb-src http://mirror.vmmatrix.net/debian/ testing main
发现一个比较快的台湾地址:
deb http://ftp.isu.edu.tw/pub/Linux/Debian/debian/ sarge main contrib non-free
国内安装源:
deb http://debian.ustc.edu.cn/debian sarge main non-free contrib
deb http://debian.ustc.edu.cn/debian-non-US sarge/non-US main non-free contrib
deb http://debian.ustc.edu.cn/debian-uo sid marillat rareware misc ustc firefly jrfonseca java
教育网常用sources.list(以下只适用于sid即unstable用户,其它版本用户请酌情更改)
中科大
deb ftp://debian.ustc.edu.cn/debian unstable main non-free contrib
deb-src ftp://debian.ustc.edu.cn/debian unstable main non-free contrib
大连理工
deb ftp://mirror.dlut.edu.cn/debian unstable main non-free contrib
deb-src ftp://mirror.dlut.edu.cn/debian unstable main non-free contrib
清华大学
deb ftp://ftp.tsinghua.edu.cn/mirror/debian/debian unstable main non-free cont
rib
deb-src ftp://ftp.tsinghua.edu.cn/mirror/debian/debian unstable main non-free
contrib
非官方软件包(uo)
中科大uo仓库:
wma、ape插件for xmms,以及 realplay等:
deb ftp://debian.ustc.edu.cn/rarewares.org unstable main
mplayer等:
deb ftp://debian.ustc.edu.cn/debian-uo sid marillat
j2re, j2sdk or mozilla java plugin:
deb ftp://debian.ustc.edu.cn/debian-uo sid java
firefly fake bold font style package:慎重使用
deb ftp://debian.ustc.edu.cn/debian-uo sid firefly
gbkfonts、xpdf等:
deb ftp://debian.ustc.edu.cn/debian-uo sid ustc
其它一些uo:
Bootsplash patches and utils:
deb http://www.bootsplash.de/files/debian unstable main
Fangzheng Fonts、Matlab7、Mathematica、cedega等:
deb ftp://202.38.73.198/debian sid foo
xmms2:
deb http://exodus.xmms.se/debian stable main
非官方软件包查询地址:
http://www.apt-get.org/search.php
2) blackdown Java
代码:
deb ftp://metalab.unc.edu/pub/linux/ ... lackdown.org/debian unstable main non-free
4) USTC 的非官方资源
代码:
deb ftp://debian.ustc.edu.cn/debian-uo sid marillat rareware ustc java misc jrfonseca firefly
deb-src ftp://debian.ustc.edu.cn/debian-uo sid marillat rareware ustc java misc jrfonseca firefly
5) 丰富资源
代码:
deb http://debian.okey.net/debian/sarge main non-free contrib
deb http://debian.okey.net/debian-uo/ unstable firefly java jrfonseca marillat misc rareware ustc
deb http://debian.okey.net/debian-non-US/ sarge/non-US main contrib
6) 提供realplayer,mplayer, acroreader, w32codecs, 等等
代码:
deb ftp://ftp.nerim.net/debian-marillat/ unstable main
deb-src ftp://ftp.nerim.net/debian-marillat/ unstable main
使用时添加到/etc/apt/sources.list里即可,但是非官方的uo软件包,使用时要慎重,以
免发生依赖性错误;如需下载sources,请自行添加deb-src,后面内容相同。
4、交大的源:源码则把加上deb-src源
有各个发行版本的源,可以参考地址ftp://ftp.sjtu.edu.cn/sites/然后写出源:
Debian:sjtu主要有这些版本:sarge,stable,etch,sid,testing,unstable,woody等版本,其中还有 etch-proposed-updates,sarge-proposed-updates,stable-proposed- updates,testing-proposed-updates,woody-proposed-updates等五个。
比如sarge版本的源可以写(其它版本只要把sarge换成相应的版本即可):
deb ftp://ftp.sjtu.edu.cn/debian sarge contrib main non-free
deb ftp://ftp.sjtu.edu.cn/debian sarge-proposed-update contrib main non-free
安全更新的源:有etch,sarge,stable,testing,woody等五个版本
以sarge版本为例:
deb ftp://ftp.sjtu.edu.cn/debian-security sarge/updates contrib main non-free

版本说明:
一般有三个版本:stable,testing,unstable
当前的stable是sarge,unstable是sid,testing是etch。
stable
The “stable” distribution contains the latest officially released distribution of Debian.
This is the production release of Debian, the one which we primarily recommend using.
The current “stable” distribution of Debian GNU/Linux is version 3.1r0,codenamed sarge. It was released on June 6th, 2005.
testing
The “testing” distribution contains packages that haven't been acceptedinto a “stable” release yet, but they are in the queue for that. Themain advantage of using this distribution is that it has more recentversions of software.
The current “testing” distribution is etch.
unstable
The “unstable” distribution is where active development of Debianoccurs. Generally, this distribution is run by developers and those wholike to live on the edge.
The “unstable” distribution is called sid.
stable — 最广泛的用于架设产品化服务器,因为它只包含安全更新。
testing — 推荐工作站用户使用的发行版,因为它包含有最近发布的桌面软件,这些软件已经接受了少量测试。
unstable — 处在悬崖边缘的版本,供 Debian 开发者选用。

====================================================

关于 Debian 源的一些简单说明

http://blog.chinaunix.net/u1/56723/showart_495550.html

原先是应联盟 Linux 区版主 sirius 的要求搜集资料写的, 在 Blog 里存一份作为备份吧。
由于内容是直接 Copy & Paste 论坛的原贴的… 所以里面给出的源也就 BIT 的哥们能用,目前不提供校外访问…

以下 stable, testing, unstable, experimental 的源算是对 Debian 软件包的一种水平划分。其实也可看成为稳定性不同的发行版本。
通常我们还会以开发代号来称呼它们,目前的 stable 的开发代号是 sagre, testing 的开发代号是 etch,而 unstable 的开发代号一直是 sid。
以前 testing 对应的是 sarge,后来 sarge 发展得差不多了,Debian 社区正式发行了 sarge,于是 sarge 就变成了 stable 版本。现在的 testing 则是 etch,将来发展稳定了etch 将变成新的 stable 版本。

stable源,就如同字面意思一样,是最稳定的源,但相对的各个软件则通常不是最新版, 一般情况下没有出现什么安全问题是不会更新的,所安装软件较少也较为固定。
如果是搭建服务器的话,一般都采用 stable 的源。

deb http://mirror.bitunion.org/debian/ stable main contrib non-free
deb-src http://mirror.bitunion.org/debian/ stable main contrib non-free

deb http://mirror.bitunion.org/debian-non-US stable/non-US main contrib non-free
deb-src http://mirror.bitunion.org/debian-non-US stable/non-US main contrib non-free

testing 源,虽名为测试版,实则已经相当接近于 stable 版本的程度,这个版本的软件多半是在 unstable 中经由维护、开发人员不断的测试之后流入,所以在某种程度来说,其实已经做过初步的检测,这里头的软件大多也是相当稳定的,而且软件也都会比 stable 里头的新,而且软件总量来说则比上 stable 要多很多。
大多数人一般都使用的都是 testing 的源。

deb http://mirror.bitunion.org/debian/ testing main contrib non-free
deb-src http://mirror.bitunion.org/debian/ testing main contrib non-free

deb http://mirror.bitunion.org/debian-non-US testing/non-US main contrib non-free
deb-src http://mirror.bitunion.org/debian-non-US testing/non-US main contrib non-free

unstable 源,个人看法这才算是 测试版 ,这里头最大的特色就是软件更新速度快,几乎都与该软件同步,因为太新相对的使用 unstable 的人也必须承担更高的风险,有时候您可能会遭遇到一早更新完所有软件后,发现有些软件不能正常运作的状况,不过庆幸的是这种情形大概只会持续一两天左右, 因为 unstable 的特色就是更新速度快,一旦有人回报问题,维护的人很快就会作修正。
如果喜欢玩软件,也不在乎有时候系统有出现一些小毛病,那就用它吧!

deb http://mirror.bitunion.org/debian/ unstable main contrib non-free
deb-src http://mirror.bitunion.org/debian/ unstable main contrib non-free

deb http://mirror.bitunion.org/debian-non-US unstable /non-US main contrib non-free
deb-src http://mirror.bitunion.org/debian-non-US unstable /non-US main contrib non-free

experimental源,按照官方的说法,里面的软件大多都是很不稳定和充满bug的,并可能导致数据的丢失….
如果想用到最新的软件并充满小白鼠的献身精神或者是立志成为Bug Reporter..那就用它吧…

deb http://mirror.bitunion.org/debian/ experimental main contrib non-free

backports源,为 Debian 提供不需要非 Stable 链接库就可在 Stable 版运行的新软件包,有效地弥补了Debian Stable版软件较旧的缺点。属于稳定性和功能之间的一个新的平衡点吧。
而且,这是 Lonecat 大大目前使用的源,还想什么,就选它吧。

deb http://mirror.bitunion.org/mirror/debian-backports sarge-backports main non-free contrib
deb http://mirror.bitunion.org/mirror/debian-bit stable main non-free contrib
deb http://mirror.bitunion.org/mirror/debian-marillat stable main

忘了还有一个 debian-uo,uo 是 Unofficial 的简写,也就是非官方的软件库。

deb http://mirror.bitunion.org/debian-uo sid marillat rareware misc ustc java firefly jrfonseca xorg
deb-src http://mirror.bitunion.org/debian-uo sid marillat rareware misc ustc java firefly jrfonseca xorg

而其中出现的 main contrib non-free 之类的,理解为一种垂直的划分吧。
因为 Debian 是非营利组织,但是组织架构严谨,有一套完善的软件管理方式。基于其对软件 free 度的一种坚持,对不同版权软件包的录入有一些限定。
下面是对它们的一些简要介绍:

main Debian 里最基本及主要且符合自由软件规范的软件 ( packages )。
contrib 这里头软件虽然可以在 Debian 里头运作,即使本身属于自由软件但多半却是相依于非自由 ( non-free ) 软件。
non-free 不属于自由软件范畴的软件。
non-us 这个分类里头的软件都来自非美国地区,当中可能有牵扯到专利、加密..等等问题。
marillat 对应 Christian Marillat 的软件仓库,包括mplayer, transcode等。
rareware 对应 rarewares.org 的软件仓库, 包括很多音效程序,如lame, musepack, beep media player等。
ustc 对应 debian@ustc 维护的一些软件包,如 mule-gbk, gaim-openq, scim, stardict dicts, patched xpdf, irssi, xmms。
java 对应 Blackdown java。包括 j2re, j2sdk ,mozilla java plugin。
firefly 对应打过firefly补丁的包,包括 fontconfig mozilla mozilla-firefox pango1.0 qt-x11-free xft
misc 对应其它无分类的包,包括 nvidia-kernel, winex3, rox, chmsee等
debian-bit Lonecat 大大自己编译的一些软件包都在这里。

最后是关于源的混用问题,一般不建议混用 stable, testing 和 unstable 的源。因为很多软件之间都有不同程度的相依性,强行的结果会造成更多软件相依、相斥问题的产生,最终可能影响系统稳定与整个软件升级制度的正常运作。

需要把源从 stable 升到 testing, unstable 或者是从 testing 升到 unstable 源是非常简单的,只要修改 sources.list 里的源就好了。但反过来,降级是一种几乎不可能的任务…

还有就是 deb-src 代表的是源代码的源。

debian的源

我是北京网通用户,现在用的源是cn99.com的,下载速度差不多在60KB/s左右,基本上算是可以了。
我的 /etc/apt/sources.list 如下:
deb http://debian.cn99.com/debian/ testing main contrib non-free
deb-src http://debian.cn99.com/debian/ testing main contrib non-free

deb http://debian.cn99.com/debian-security/ etch/updates main contrib
deb-src http://debian.cn99.com/debian-security/ etch/updates main contrib

如果你觉得你 apt-get 的速度奇慢,或者软件库里的软件不全,那你或许该修改一下你的/etc/apt/sources.list了。

授之以鱼,不如授之以渔。下面是一些网上搜到的资料,学习一下你就可以自己按需修改自己的sources.list了。

a. Debian 的版本究竟是如何划分的?

转载自水木社区 LinuxApp版 精华区x-1-12
Debian 有自己独特的版本系统,整个系统有三个版本,分别为稳定版(stable),测试版(testing)和不稳定版(unstable)。每次发布的版本都是稳定版,而测试版在经过一段时间的测试证明没有问题后会成为新的稳定。因为稳定版是会更新的,为了便于区分不同时期的稳定版,每个版本又有自己特有的代号(codename),现在的稳定版称为 etch,测试版称为lenny。而不稳定版的代号永远是 sid。普通用户使用testing或者unstable都可以。

b. sources.list的写法

1)找到包含dists和pool这两个目录的那个目录,把地址记下来,比如 http://debian.cn99.com/debian/;
2)打开dists,里面包含的目录名字,记下来。比如http://mirrors.geekbone.org/debian/,dists/包含sarge、etch、lenny、sid。

3)把这些目录名字记下来;打开以上目录,看看里面包含哪些组件目录,比如main、contrib、non-free;

4)书写格式:deb <1记下来的地址> <2记下来的名字> <3记下来的名字s>,如:
deb ftp://ftp.linuxforum.net/debian/ sarge main contrib non-free

c. 这里有一篇更详细的:关于 Debian 源的一些简单说明(http://blog.xiaoduo.info/?p=3)

我已转载了这篇文章,在这里。

12、 更新软件包列表信息,升级debian

修改 /etc/apt/sources.list 之后一般会运行下面两个命令进行更新升级:
sudo apt-get update
sudo apt-get dist-upgrade

其中 :
update - 取回更新的软件包列表信息
dist-upgrade - 发布版升级
第一个命令仅仅更新的软件包列表信息,所以很快就能完成。
第二个命令是全面更新发布版,一般会下载几百兆的新软件包。

其实在运行完第一个命令后系统就会提示你进行更新升级。因为修改了源,所有这次更新的改动可能会很大,比如安装某个包可能会删除太多的其他包,所有系统会提示你运行“sudo apt-get dist-upgrade”进行全面升级或使用软件包管理器中的“标记全部软件包以便升级”功能进行升级。两者效果是一样的。

13、debian升级后的问题

升级后重启,会发现多出了两个系统:
Debian GNU/Linux, kernel 2.6.22-3-686

Debian GNU/Linux, kernel 2.6.22-3-686 (single-user mode)

进第一个看看,可能一切正常,那恭喜你,你升级成功了;也可能还没到登录界面就停止不动了,屏幕上有诸如下面的信息:
"resume: could not stat the resume device file.
Please type in the name to try again or press ENTER to boot the system"

"Waiting for root file system"

耐心等待三五分钟系统会进入到busybox。
此时,可以重新启动机器,进入原来的系统:
Debian GNU/Linux, kernel 2.6.18-6-686

进入后可能桌面不能正常显示,如我的情况见图:

不要急,这时因为升级后gnome没安装上的原因。从 系统->系统管理->新立得软件包管理器 中安装gnome和Nautilus,或 在终端运行“sudo apt-get install gnome nautilus” 后重启即可正常。

然后,做一下几步:

a. 修改/etc/fstab文件

把所有的hda、hdb或hdc改成sda,或正好相反。这要看你的硬盘是不是sata的。

b. 运行“sudo update-initramfs -u -k all”(参考这里)

c. 应该就这两步吧,唉,前天的事了,有点记不起来,抱歉。

重新启动,选择那个新的系统,一切正常(这时候原来那个系统或许就不能用了)。

14、iceweasel + flash player

用iceweasel浏览有flash的网页,它会提示安装新的插件,安装完后它仍然提示,如此反复,似乎并没有安装成功。

解决办法:
到adobe官网(www.adobe.com)下载安装包进行安装就行了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: