83457807 2015-07-07
如下:
debian:~#mkdir –r /media/dvd1
debian:~#mkdir –r /media/dvd2
debian:~#mkdir –r /media/dvd3
….
debian:~#mkdir –r /media/dvdN
debian:~#cd /iso
debian:/iso#mount –o loop debian-506-amd64-DVD-1.iso /media/dvd1/
debian:/iso#mount –o loop debian-506-amd64-DVD-2.iso /media/dvd2/
debian:/iso#mount –o loop debian-506-amd64-DVD-3.iso /media/dvd3/
…
debian:/iso#mount –o loop debian-506-amd64-DVD-N.iso /media/dvdN/
debian:/iso#cd /etc/apt/
debian:/etc/apt/#cp sources.list sources.list.bak
debian:/etc/apt/#vim sources.list
(在编辑器中仅列入如下内容)
deb file:///media/dvd1/ lenny main contrib non-free
deb-src file:///media/dvd1/ lenny main contrib non-free
deb file:///media/dvd1/ stable main contrib non-free
deb-src file:///media/dvd1/ stable main contrib non-free
deb file:///media/dvd2/ lenny main contrib non-free
deb-src file:///media/dvd2/ lenny main contrib non-free
deb file:///media/dvd2/ stable main contrib non-free
deb-src file:///media/dvd2/ stable main contrib non-free
deb file:///media/dvd3/ lenny main contrib non-free
deb-src file:///media/dvd3/ lenny main contrib non-free
deb file:///media/dvd3/ stable main contrib non-free
deb-src file:///media/dvd3/ stable main contrib non-free
deb file:///media/dvd4/ lenny main contrib non-free
deb-src file:///media/dvd4/ lenny main contrib non-free
deb file:///media/dvd4/ stable main contrib non-free
deb-src file:///media/dvd4/ stable main contrib non-free
。。。
deb file:///media/dvdN/ lenny main contrib non-free
deb-src file:///media/dvdN/ lenny main contrib non-free
deb file:///media/dvdN/ stable main contrib non-free
deb-src file:///media/dvdN/ stable main contrib non-free
debian:/etc/apt/#apt-get update
有些报错(fail或error)可能是因为/media/dvdN/dists/下没有相关目录条目,没关系。最后恭喜您可以本地安装大部分(本例为debian 506 ,代号为lenny)的稳定版本软件包啦。
延伸:存放如此大容量的iso文件在本地服务器内,浪费存储资源,后续会实现在远程、局域网、移动媒介等设立自己的apt源。移动媒介仅第1、2步略有不同,其他步骤均相同。