使用开源工具 apt-mirror 可以用于镜像 APT repository。
-
安装
apt-mirror
:sudo apt-get install apt-mirror
-
创建apt镜像存储目录:
mkdir /path/to/repo-mirror
-
确定版本 which version of Ubuntu or Debian 。需要将其加入到apt-mirror config。
-
修改apt-mirror config, 使用顺手的编辑器:
sudo nano /etc/apt/mirror.list
这个缺省的
/etc/apt/mirror.list
配置分为两个段。上面的包含global configuration values. 设置base_path 为刚才创建的目录。set base_path /path/to/repo-mirrorset nthreads 5 set _tilde 0
下面的部分
/etc/apt/mirror.list
包含镜像苦的列表。使用下面的方式,替换 ubuntu 和 trusty 为你的Linux distribution and version:deb https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty main deb-src https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/ trusty main
-
运行 apt-mirror 来创建 mirror。
sudo apt-mirror
-
APT repository mirror 已经可用了。
搭建服务:
- 使用容器技术搭建apt镜像站,https://my.oschina.net/u/2306127/blog/1626991