使用apt
使用 apt
2023-06-13 09:13:16 时间
使用apt
· · 127 次点击 ·
·
开始浏览
debian官方提供了脚本ftpsync来搭建源镜像,而 apt-mirror 是一个更简单便捷的源镜像搭建工具。
安装 apt-mirror
sudo apt-get install apt-mirror
配置文件/etc/apt/mirror.list只要修改很少的地方,大部分使用默认值即可。
这里使用中科大镜像 ftp.cn.debian.org 作为上游镜像,只镜像 debian jessie amd64 架构,不镜像源代码包。
############# config ################## # 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 cleanscript $var_path/clean.sh # set defaultarch # 默认架构与镜像主机的架构一致,这里是amd64 # set postmirror_script $var_path/postmirror.sh # set run_postmirror 0 set nthreads 20 set _tilde 0 ############# end config ############## deb http://ftp.cn.debian.org/debian jessie main contrib non-free deb http://ftp.cn.debian.org/debian/ jessie-backports main contrib non-free deb http://ftp.cn.debian.org/debian/ jessie-proposed-updates main contrib non-free deb http://ftp.cn.debian.org/debian/ jessie-updates main contrib non-free deb http://ftp.cn.debian.org/debian-security/ jessie/updates 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-mips http://ftp.us.debian.org/debian unstable main contrib non-free #deb-mipsel http://ftp.us.debian.org/debian unstable main contrib non-free #deb-powerpc http://ftp.us.debian.org/debian unstable main contrib non-free #deb-s390 http://ftp.us.debian.org/debian unstable main contrib non-free #deb-sparc http://ftp.us.debian.org/debian unstable main contrib non-free clean http://ftp.cn.debian.org/debian
开启自动同步
只需 root 权限 cron 自动运行 apt-mirror 命令即可。
# m h dom mon dow command 0 0 * * * apt-mirror
发布镜像服务
使用nginx发布源镜像
将 apt-mirror 的镜像目录链接到/var/www/mirror
# ln -sf /var/spool/apt-mirror/mirror/ftp.cn.debian.org/ mirror
然后将nginx默认主机default(或者单独虚拟主机)的根目录设置为/var/www/mirror,并开启目录列表
root /var/www/mirror location / { autoindex on;
其他机器就可以正常使用新建的源镜像了。
127 次点击
加入收藏
相关文章
- Fabric.js 使用纯色遮挡画布(前景色)
- pycharm无法使用第三方库_pycharm第三方库安装路径
- 【开发日记】SpringBoot中使用MongoDB
- 一顿饭的时间,教你怎样快速使用 动态代理ip 做一个获取Steam 热销商品 的方法
- apt命令之软件仓库管理使用一览表
- 使用OAuth2实现授权服务
- Oracle 视图 DBA_JAVA_POLICY 官方解释,作用,如何使用详细说明
- Oracle 视图 V$GES_CONVERT_LOCAL 官方解释,作用,如何使用详细说明
- Linux下APT命令的精彩使用(linuxapt命令)
- 使用Linux SSH跳板机提升服务器安全性(linuxssh跳板机)
- 快速使用CMD命令进入MySQL(cmd命令进入mysql)
- 如何在 Ubuntu 16.04 强制 APT 包管理器使用 IPv4
- 在 Ubuntu 中使用轻量的 Apt 软件包管理器 Synaptic
- Oracle数据库管理:子表使用(oracle子表)
- MySQL中i变量的作用及使用方法(mysql中 i变量)
- 安装宝塔,一键Apt安装MySQL服务器(apt安装宝塔mysql)
- Apt删除MySQL轻松实现一键式删除(apt 删除mysql)
- 探究APT下载MySQL慢的原因(apt下载mysql很慢)
- APT一键安装MySQL,快速解决数据库问题(apt 下载mysql)
- 在CMD中如何使用MySQL快速建立表格(cmd中mysql建表)
- 无外键,MySQL数据库的设计和优化方法(mysql 不使用外键)
- 使用Oracle之新功能,提高效率(oracle new用法)
- jquery属性过滤选择器使用示例
- jquery阻止冒泡事件使用模拟事件
- sql使用cast进行数据类型转换示例