Linux中国  设为主页
 收藏本站
 
当前位置: > 首页 ->Linux技术 ->发行版专区 ->Debian ->使用apt-mirror构建本地Debian镜像
· Debian GNU/Linux 完全安装手册· Debian On Slug的安装笔记· 在 debian 上玩 dos 游戏·菜鸟乐园 Debian GNU/Linux的安装过程 ·Debian GNU/Linux Rssh安全绕过漏洞 ·Debian4(Etch)系统简要安装详细介绍 ·使用apt-mirror构建本地Debian镜像 ·Debian On Slug的安装笔记 ·Debian+vsftpd+MySQL实现虚拟用户
  相关分类: 
CentOS
ubuntu
turbolinux
Suse
slackware
Redhat
Mepis
mandriva
Mandrake
knoppix
Gentoo
Fedora
Debian
红旗
  站内搜索: 
热门文章排行
热门文章排行 Debian4(Etch)系统简要安装详细介(04-27)
使用apt-mirror构建本地Debian镜像 (04-22)
Debian/Ubuntu Linux下内核编程者必(04-11)
debian配置PHP5+MYSQL+Apache (04-16)
Kubuntu 6.10 安装指南(图) (04-22)
精采文章排行
精采文章排行 《Debian服务器设置入门》系列教程 (05-05)
Debian GNU/Linux 完全安装手册(05-05)
Debian On Slug的安装笔记(05-05)
在 debian 上玩 dos 游戏(05-05)
菜鸟乐园 Debian GNU/Linux的安装过(05-01)
 

使用apt-mirror构建本地Debian镜像

作者:Falko Timme    来源:linux.chinaunix.net   点击:   日期:2007-04-22 [收藏] [投稿]

  IE是否经常中毒?推荐您

On Ubuntu Edgy Eft, the file looks like this:

############# config ##################
#
# set base_path    /var/spool/apt-mirror
#
# if you change the base path you must create the directories below with write privlages
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  
set nthreads     20
set tilde 0
#
############# end config ##############

deb http://archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu edgy-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu edgy-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu edgy-proposed main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu edgy-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu edgy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu edgy-proposed main restricted universe multiverse

clean http://archive.ubuntu.com/ubuntu

If you compare the file with /etc/apt/sources.list, you will see that it's very similar. /etc/apt/mirror.list mainly lists the repositories that should be mirrored, plus a few other options.

Now we modify /etc/apt/mirror.list. As I said before, I want to mirror the main, contrib, and non-free sections of Debian Sarge and the main, restricted, and universe sections of Ubuntu Edgy Eft, but I don't want to mirror the security updates as these should be downloaded directly from the internet. Also, I don't want to mirror the source packages because in 95% of all installations you don't need source packages, and they need a lot of space on the hard disk. So my /etc/apt/mirror.list looks like this:

vi /etc/apt/mirror.list

# apt-mirror configuration file

##
## The default configuration options (uncomment and change to override)
##
#
# set base_path    /var/spool/apt-mirror
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
#
# set defaultarch  
# set nthreads     20
#


##
## Example sources
##

# sarge's section
deb http://ftp.de.debian.org/debian sarge main contrib non-free

# Ubuntu Edgy Eft
deb http://de.archive.ubuntu.com/ubuntu/ edgy main restricted universe

##
## Cleaner configuration example
##
#
# set cleanscript $var_path/clean.sh
#

# Cleaning section
clean http://ftp.de.debian.org/
clean http://de.archive.ubuntu.com/

Please note that I used ftp.de.debian.org instead of ftp.fi.debian.org and de.archive.ubuntu.com instead of archive.ubuntu.com. You should use mirrors that are close to you, so if you are in the U.S., for example, replace de with us, and so on.

The cleaning section at the end tells apt-mirror in which directories on the local hard disk it should check to see if hard disk space can be freed. I want to check the whole local repositories for both Debian and Ubuntu, therefore I specify

clean http://ftp.de.debian.org/
clean http://de.archive.ubuntu.com/

If you want to use other Debian/Ubuntu versions, simply replace sarge with etch or sid and edgy with breezy, dapper, etc.

5 Create The Local Repositories

Now that apt-mirror is configured, it's time to run it for the first time and download all the packages that form the local Debian and Ubuntu repository. All we have to do is type

su - apt-mirror -c apt-mirror

apt-mirror tells you how many GB it must download. This can take a few hours, so be patient. The packages will be stored in subdirectories of the /var/spool/apt-mirror/mirror directory, so make sure the partition that holds that directory has enough disk space left.

The Debian repository will be in

 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<

上一页 1 23 4 下一页

上一篇:Debian On Slug的安装笔记   下一篇:Debian4(Etch)系统简要安装详细介绍
文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论

   相关文章:
·《Debian服务器设置入门》系列教程 前言

   文章评论:(1条)
  
 请留名: 匿名评论   点击查看所有评论 论坛讨论
 

 声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。