外网同步所有ubuntu源到内网使用

同步外网清华源的ubuntu源到内网使用

1.内网源使用只需要dist目录和pool目录

18.04 = bionic、20.04 = focal、22.04 = jammy、24.04 = noble

#同步ubuntu18.04的dists目录

rsync -avz --delete --bwlimit=10000 --include="dists/bionic/**" --exclude="pool/**" --exclude="*.iso" --exclude="dists/*/main/debian-installer" rsync://mirrors.tuna.tsinghua.edu.cn/ubuntu/ /data/ubuntu-repos/

#同步ubuntu20.04的dists目录

rsync -avz --delete --bwlimit=10000 --include="dists/focal/**" --exclude="pool/**" --exclude="*.iso" --exclude="dists/*/main/debian-installer" rsync://mirrors.tuna.tsinghua.edu.cn/ubuntu/ /data/ubuntu-repos/

#同步ubuntu22.04的dists目录

rsync -avz --delete --bwlimit=10000 --include="dists/jammy/**" --exclude="pool/**" --exclude="*.iso" --exclude="dists/*/main/debian-installer" rsync://mirrors.tuna.tsinghua.edu.cn/ubuntu/ /data/ubuntu-repos/

#同步ubuntu24.04的dists目录

rsync -avz --delete --bwlimit=10000 --include="dists/noble/**" --exclude="pool/**" --exclude="*.iso" --exclude="dists/*/main/debian-installer" rsync://mirrors.tuna.tsinghua.edu.cn/ubuntu/ /data/ubuntu-repos/

#同步pool目录,pool目录是所有ubuntn的包,不到4T, 无法只同步指定版本的

rsync -avz --delete --bwlimit=5000 --include="pool/main/**" --include="pool/restricted/**" --include="pool/universe/**" --include="pool/multiverse/**" --exclude="dists/**" --exclude="pool/*/debug" --exclude="*.iso" rsync://mirrors.tuna.tsinghua.edu.cn/ubuntu/ /data/ubuntu-repos/

2.最后把ubuntu-repos目录同步到内网环境,在通过nginx指向这个目录即可

相关推荐
专注echarts研发20年2 小时前
Qt自定义双击事件实现方案(规避原生双击附带单击问题)
数据库
墨香幽梦客2 小时前
系统性能优化技巧:数据库索引、缓存与异步处理的综合应用
数据库·缓存·性能优化
若风的雨2 小时前
HIP 设备管理与初始化
linux
zfxwasaboy2 小时前
DRM KMS 子系统(5)Device/demo
linux·c语言
物理与数学2 小时前
linux内核常用hook机制
linux·linux内核
麦麦在写代码2 小时前
Mysql--DDL语句
数据库·mysql
周公挚友2 小时前
centos 7.9 防火墙
linux·运维·centos
梁正雄2 小时前
linux服务-麒麟10安装sqlserver
linux·运维·sqlserver
飞Link2 小时前
cmd、powershell、linux下命令对比
linux·运维·服务器