debian jessie 搭建镜像源:方法一

本文介绍了如何在debian jessie系统中利用apt-mirror工具来搭建本地镜像源。首先,需要安装apt-mirror,接着编辑/etc/apt/mirror.list配置文件,最后配置nginx以提供镜像服务。这个过程对于优化客户端的软件包下载速度非常有帮助。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用 apt-mirror 作为镜像源

安装apt-mirror

apt-get install apt-mirror

vi /etc/apt/mirror.list

############# config ##################
# 这里可以改路径
# set base_path    /var/spool/apt-mirror

set base_path    /aptdata/apt-mirror
# 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  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

#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

# mirror additional architectures
#deb-alpha http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-amd64 http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-armel http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-hppa http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-i386 http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-ia64 http://ftp.us.debian.org/debian unstable main contrib non-free
#deb-m68k http://ftp.us.debian.org/debian unstable main contrib non-free

deb http://mirrors.163.com/debian/ jessie main non-free contrib
deb http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ jessie-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ jessie/updates main non-free contrib

执行命令

apt-mirror

nginx 配置文件

 server {
    listen        80;
    server_name   x.x.x.x;
    
    location / {
	    autoindex on;
        autoindex_exact_size off;
	    root /aptdata/apt-mirror/mirror/mirrors.163.com/;
    }
}

客户端的配置文件

自己搭建的源,安装的时候报 
WARNING: The following packages cannot be authenticated!
在源里面增加  [trusted=yes] 安装的时候就不会有警告了
deb [trusted=yes] http://x.x.x.x/debian/ jessie main non-free contrib

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值