建立Ubuntu apt的本地Mirror

原创
2015/12/10 11:00
阅读数 1.4K

使用开源工具 apt-mirror 可以用于镜像 APT repository。

  1. 安装 apt-mirror:

    sudo apt-get install apt-mirror

     

  2. 创建apt镜像存储目录:

    mkdir /path/to/repo-mirror

     

  3. 确定版本 which version of Ubuntu or Debian 。需要将其加入到apt-mirror config。

  4. 修改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

         

  5. 运行 apt-mirror 来创建 mirror。

    sudo apt-mirror

         

  6. APT repository mirror 已经可用了。

搭建服务:

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部