当前位置:首页 > 开发 > 操作系统 > 正文

debian_用iso文件创建本地apt源

发表于: 2015-07-07   作者:2002wmj   来源:转载   浏览:
摘要: 1.将N个debian-506-amd64-DVD-N.iso存放于本地或其他媒介内,本例是放在本机/iso/目录下 2.创建N个挂载点目录 如下: debian:~#mkdir –r /media/dvd1 debian:~#mkdir –r /media/dvd2 debian:~#mkdir –r /media/dvd3 …. debian:~#mkdir –r /media

1.Ndebian-506-amd64-DVD-N.iso存放于本地或其他媒介内,本例是放在本机/iso/目录下

2.创建N个挂载点目录

如下:

debian:~#mkdir –r /media/dvd1

debian:~#mkdir –r /media/dvd2

debian:~#mkdir –r /media/dvd3

….

debian:~#mkdir –r /media/dvdN

 

3.挂载iso文件

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/

 

4.将旧apt源列表文件做备份,然后更改其内容

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

 

5.更新目录

debian:/etc/apt/#apt-get update

 

有些报错(failerror)可能是因为/media/dvdN/dists/下没有相关目录条目,没关系。最后恭喜您可以本地安装大部分(本例为debian 506 ,代号为lenny)的稳定版本软件包啦。

 

 

延伸:存放如此大容量的iso文件在本地服务器内,浪费存储资源,后续会实现在远程、局域网、移动媒介等设立自己的apt源。移动媒介仅第12步略有不同,其他步骤均相同。

debian_用iso文件创建本地apt源

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号