1、假设*.iso存放在一个ext3分区/dev/hda2的/debian/debian-iso目录中。
2、新建挂载目录

# mkdir /apt
 # mkdir /apt/iso /apt/cd01 /apt/cd02 /apt/cd03 /apt/cd04 /apt/cd05 /apt/cd06 /apt/cd07 /apt/cd08 /apt/cd09 /apt/cd10 /apt/cd11 /apt/cd12 /apt/cd13 /apt/cd14


3、挂载分区:# mount /dev/hda2 /apt/iso
3、挂载镜像:

# mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-1.iso /apt/cd01
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-2.iso /apt/cd02
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-3.iso /apt/cd03
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-4.iso /apt/cd04
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-5.iso /apt/cd05
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-6.iso /apt/cd06
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-7.iso /apt/cd07
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-8.iso /apt/cd08
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-9.iso /apt/cd09
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-10.iso /apt/cd10
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-11.iso /apt/cd11
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-12.iso /apt/cd12
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-13.iso /apt/cd13
 # mount -t iso9660 -o loop /apt/iso/debian/debian-iso/debian-31r0a-i386-binary-14.iso /apt/cd14


4、设置apt源:
# apt-setup
(1)先进入“edit sources list by hand”项,用“#”注释掉全部源(也可全部删除),然后用“:wq”存盘退出。
(2)提示“Add another apt source? ”对话框,选“Yes”,再选“filesystem”项,输入“/apt/cd01”然后“OK”。
(3)重复(2)直到14张盘全部加进去(注意:/apt/cd01分别要改为/apt/cd02、/apt/cd03……/apt/cd14)。
(4)提示“Add another apt source? ”对话框,选“No”。
(5)提示“Use security updates from security.debian.org?”对话框,选“No”。

 

 

5. 设置debian sources.list


2008年09月24日 星期三 22:01


sources.list 是我们在安装软件前所必需配置的一个文件,它告诉linux你所希望安装文件的存放路径(也就是那里可以找到他们),这里可以使网络路径,即所谓的网络安装,也可以使本地的文件路径。下面是我的一些设置心得。

1。本地安装
首先,linux对设备的访问都是以文件的形式进行的,因此不管你是硬盘也好,cd-rom,或iso文件,你首先要通过mount命令加载。
如果你已经下载了安装文件(比如是对应第一张光盘的),放在你的fat分区,如第二个分区下的一个叫debian 1的目录,那么你先加载分区如:

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等安装。