关于怎样配置debian的sources.list
来源:
ChinaUnix博客 作者: 发布时间:2008-04-25 04:00:12


最近使用debian,对其sources.list的配置有些疑问.找到了这篇文章学习一下,原文地址
http://bbs.linuxsir.org/showthread.php?t=3516
sources.list 是我们在安装软件前所必需配置的一个文档,他告诉linux您所希望安装文档的存放路径(也就是那里能够找到他们),这里能够使网络路径,即所谓的网络安装,也能够使本地的文档路径。下面是我的一些配置心得。
1。本地安装
首先,linux对设备的访问都是以文档的形式进行的,因此不管您是硬盘也好,cd-rom,或iso文档,您首先要通过mount命令加载。
假如您已下载了安装文档(比如是对应第一张光盘的),放在您的fat分区,如第二个分区下的一个叫debian1的目录,那么您先加载分区如:
cd /mnt ; mkdir d; mount -t vfat /dev/hda2 /mnt/d
可在sources.list中添加如下
deb file:///mnt/debian1/ woody main contrib
deb file:///mnt/debian1/ woody/non-US main contrib
这里是有规律的,您可先查一下debian1下的目录结构,其中有个目录dist是默认添加的,woody是dist目录下的一个最新的stable版本,更有其他的老的或testing连同unstable版,main和contrib是woody下的两个目录(有些还包括一个叫non-free的目录),non-US是非美国的,牵扯到一些由于版权连同加密的软件,他下面同样有main contrib(有几个目录都选上)。
iso文档安装
类似,首先加载iso文档,有些不同
cd /mnt ;mkdir d ;mount -t vfat /dev/hda2 /mnt/d ;mkdir iso1 ;mkdir iso2 ;......
cd d;看到您的iso文档了吧;
mount -t iso9660 -o loop youisofile1.iso /dev/iso1
mount -t iso9660 -o loop youisofile2.iso /dev/iso2
依此类推有几个全挂上,vi /etc/apt/sources.list
deb file:///mnt/iso1/ woody main contrib
deb file:///mnt/iso1/ woody/non-US main contrib
deb file:///mnt/iso2/ woody main contrib
deb file:///mnt/iso2/ woody/non-US main contrib
.......
2.网络安装相对简单,但是不同的mirrorsite,他的目录结构可能不同,您可用一下方法察看
如ftp ftp.jp.debian.org
anonymous
aaa@msn
ftp>ls
我的配置如下:
# Official Debian mirrors
#
# Debian "potato" (2.2)
#
#deb
http://ftp.us.debian.org/debian
potato main contrib non-free
#deb-src
http://ftp.us.debian.org/debian
potato main contrib non-free
# Debian "stable" (presently the same as "Woody")
#
deb
http://ftp.us.debian.org/debian
stable main contrib non-free
deb-src
http://ftp.us.debian.org/debian
stable main contrib non-free
# Debian "Woody" (3.0)
#
deb
http://ftp.us.debian.org/debian
woody main contrib non-free
deb-src
http://ftp.us.debian.org/debian
woody main contrib non-free
# Debian "testing" (presently the same as "Sarge")
#
deb
http://ftp.us.debian.org/debian
testing main contrib non-free
deb-src
http://ftp.us.debian.org/debian
testing main contrib non-free
# Debian "Sarge" (> 3.0)
#
deb
http://ftp.us.debian.org/debian
sarge main contrib non-free
deb-src
http://ftp.us.debian.org/debian
sarge main contrib non-free
# Debian "unstable" ("Sid" will always be unstable.)
#
#deb
http://ftp.us.debian.org/debian
unstable main contrib non-free
#deb-src
http://ftp.us.debian.org/debian
unstable main contrib non-free
# Debian "Sid" (> 3.0)
#
#deb
http://ftp.us.debian.org/debian
sid main contrib non-free
#deb-src
http://ftp.us.debian.org/debian
sid main contrib non-free
# Debian "Potato" Non-US (crypto, 2.2)
#
#deb
http://non-us.debian.org/
potato/non-US main contrib non-free
#deb-src
http://non-us.debian.org/
potato/non-US main contrib non-free
# Debian "stable" Non-US (crypto)
#
deb
http://non-us.debian.org/
stable/non-US main contrib non-free
deb-src
http://non-us.debian.org/
stable/non-US main contrib non-free
# Debian "Woody" Non-US (crypto)
#
deb
http://non-us.debian.org/
woody/non-US main contrib non-free
deb-src
http://non-us.debian.org/
woody/non-US main contrib non-free
# Debian "testing" Non-US (crypto)
#
deb
http://non-us.debian.org/
testing/non-US main contrib non-free
deb-src
http://non-us.debian.org/
testing/non-US main contrib non-free
# Debian "Sarge" Non-US (crypto)
#
deb
http://non-us.debian.org/
sarge/non-US main contrib non-free
deb-src
http://non-us.debian.org/
sarge/non-US main contrib non-free
# Debian "unstable" Non-US (crypto)
#
#deb
http://non-us.debian.org/
unstable/non-US main contrib non-free
#deb-src
http://non-us.debian.org/
unstable/non-US main contrib non-free
# Debian "Sid" Non-US (crypto)
#
#deb
http://non-us.debian.org/
sid/non-US main contrib non-free
#deb-src
http://non-us.debian.org/
sid/non-US main contrib non-free
这里deb-src表示可获取源代码。
更有日本的ftp.jp.debian.org也很不错,只要把前面的ftp.us.debian.org的
us改为jp就好了。
不用的用#注释掉。
这里要注意,版本主要分为stable,testing,unstable版,现在stable为woody3.0,其中unstable的软件最新,但最不稳定,不推荐使用,而testing的软件相对较新比较稳定,推荐。
还要注意的是,您假如用了stable,同时用了testing,那么升级后为testing,类似,假如还选了unstable的,那么结果就为unstable,因此推荐只选stable和
testing的,这样的话装好后就比较稳定。
接着用一下命令升级
apt-get update
apt-get upgrade
apt-get dist-upgrade
装软件用apt-get install name
或用dselect ,tasksel ,aptitude等安装。
祝大家安装愉快,更有大家都把自己知道的一些速度快的,更新快的mirrorsite公开出来,好让我们一起分享,谢谢!
|
还没有关于此文章的相关评论!