使用开源工具 apt-mirror 能够用于镜像 APT repository。git
安装 apt-mirror
:github
sudo apt-get install apt-mirror
建立apt镜像存储目录:ubuntu
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 为刚才建立的目录。gitlab
set base_path /path/to/repo-mirrorset nthreads 5 set _tilde 0
下面的部分 /etc/apt/mirror.list
包含镜像苦的列表。使用下面的方式,替换 ubuntu 和 trusty 为你的Linux distribution and version:.net
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。code
sudo apt-mirror
APT repository mirror 已经可用了。blog
搭建服务:get