https://wiki.debian.org/DebianRepository/Setup#Debian_Repository_Mirroring_Tools
推荐使用 apt-mirror 工具来进行镜像。
该软件通过加载配置文件 /etc/apt/mirror.list 进行 apt 站点进行同步。该配置文件大概分成三部分,一是本地数据存放路径等变量配置;二是镜像软件源站点信息,该信息与 /etc/apt/sources.list 等 debian 系配置镜像站点类似,但是也有些不同。
配置中,最重要的是地址信息。由于条件限制,当前 ATZLinux 镜像软件源并非运行在标准80和443端口,而是2443等非标准 HTTP/HTTPS 端口。而 apt-mirror 软件在读取配置过程中,即使配置了非标准端口的 apt 条目,依旧会直接使用标准协议的 HTTP 80 或者 HTTPS 443 端口进行数据拉取,因此也会导致最终 apt-mirror 镜像软件失败。
基于此,整理配置思路如下:
配置文件:/etc/nginx/conf.d/fun.ie8.pub.conf,内容如下:
```
server {
listen 80;
server_name fun.ie8.pub.local;
location ^~ /atzlinux {
proxy_pass https://fun.ie8.pub:2443/atzlinux/;
proxy_set_header Host fun.ie8.pub;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_ssl_protocols TLSv1.2 TLSv1.3;
proxy_ssl_ciphers 'HIGH:!aNULL:!MD5';
proxy_ssl_verify off; # Set to 'on' if you have a valid certificate
add_header X-Cache $upstream_cache_status;
access_log /var/log/nginx/fun.ie8.pub.a.log;
error_log /var/log/nginx/fun.ie8.pub.e.log;
}
}
```
配置文件:/etc/apt/mirror.list,内容如下: ``` ############# config ################## #set base_path /var/spool/apt-mirror set script_path /var/spool/apt-mirror set base_path /data/apt-mirror # set mirror_path $base_path/mirror set skel_path $base_path/skel set var_path $script_path/var set cleanscript $var_path/clean.sh set defaultarchset postmirror_script $var_path/postmirror.sh set run_postmirror 0 set nthreads 20 set _tilde 0 # ############# end config ############## # 以镜像软件站点 https://fun.ie8.pub:2443/atzlinux/ 为例,配置如下: deb-amd64 http://fun.ie8.pub.local/atzlinux/ bookworm main contrib non-free non-free-firmware deb-src http://fun.ie8.pub.local/atzlinux/ bookworm main contrib non-free non-free-firmware deb-i386 http://fun.ie8.pub.local/atzlinux/ bookworm main contrib non-free non-free-firmware deb-arm64 http://fun.ie8.pub.local/atzlinux/ bookworm main contrib non-free non-free-firmware deb-loong64 http://fun.ie8.pub.local/atzlinux/ bookworm main contrib non-free non-free-firmware deb-riscv64 http://fun.ie8.pub.local/atzlinux/ bookworm main contrib non-free non-free-firmware deb-amd64 http://fun.ie8.pub.local/atzlinux/ bullseye main contrib non-free non-free-firmware deb-arm64 http://fun.ie8.pub.local/atzlinux/ bullseye main contrib non-free non-free-firmware #deb-amd64 http://home.taotieren.com.local/atzlinux/ bookworm main contrib non-free non-free-firmware #deb-i386 http://home.taotieren.com.local/atzlinux/ bookworm main contrib non-free non-free-firmware #deb-arm64 http://home.taotieren.com.local/atzlinux/ bookworm main contrib non-free non-free-firmware #deb-loong64 http://home.taotieren.com.local/atzlinux/ bookworm main contrib non-free non-free-firmware #deb-riscv64 http://home.taotieren.com.local/atzlinux/ bookworm main contrib non-free non-free-firmware #deb-amd64 http://home.taotieren.com.local/atzlinux/ bullseye main contrib non-free non-free-firmware #deb-arm64 http://home.taotieren.com.local/atzlinux/ bullseye main contrib non-free non-free-firmware clean http://fun.ie8.pub/atzlinux/ #clean http://home.taotieren.com.local/atzlinux/ ```
《铜豌豆 Linux》官网二维码
版权所有 © 《铜豌豆 Linux》 项目网站版权协议为(CC BY-NC-ND 4.0)