码迷,mamicode.com
首页 > 其他好文 > 详细

Debian 采用 iso 镜像作为 apt 源

时间:2018-08-07 23:58:48      阅读:400      评论:0      收藏:0      [点我收藏+]

标签:so文件   erro   软件   报错   debian   延伸   挂载   自己的   关系   

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/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

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

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

Debian 采用 iso 镜像作为 apt 源

标签:so文件   erro   软件   报错   debian   延伸   挂载   自己的   关系   

原文地址:https://www.cnblogs.com/mouseleo/p/9440010.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!