zoukankan      html  css  js  c++  java
  • 创建本地Ubuntu镜像

      • 参考文档 http://www.howtoforge.com/local_debian_ubuntu_mirror
      •  
      • 安装服务 : sudo apt-get install apt-mirror apache2
      •  
      • 配置apt-mirror(/etc/apt/mirror.list)
        ############# config ###################set base_path    /mnt/raid5/apt-mirror############# config ##################
        #修改默认路径
        set base_path    /mnt/raid5/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 #<running host architecture>
        set postmirror_script $var_path/postmirror.sh
        set run_postmirror 0
        set nthreads     20
        set _tilde 0
        #
        ############# end config ##############
        #Ubuntu 12.04 LTS
        deb http://mirrors.163.com/ubuntu precise main restricted universe multiverse
        deb http://mirrors.163.com/ubuntu precise-security main restricted universe multiverse
        deb http://mirrors.163.com/ubuntu precise-updates main restricted universe multiverse
        #deb http://mirrors.163.com/ubuntu precise-proposed main restricted universe multiverse
        #deb http://mirrors.163.com/ubuntu precise-backports main restricted universe multiverse
        #Ubuntu 14.04 LTS
        deb http://mirrors.163.com/ubuntu trusty main restricted universe multiverse
        deb http://mirrors.163.com/ubuntu trusty-security main restricted universe multiverse
        deb http://mirrors.163.com/ubuntu trusty-updates main restricted universe multiverse
        #没有同步源代码
        #deb-src http://mirrors.163.com/ubuntu precise main restricted universe multiverse
        #deb-src http://mirrors.163.com/ubuntu precise-security main restricted universe multiverse
        #deb-src http://mirrors.163.com/ubuntu precise-updates main restricted universe multiverse
        #deb-src http://mirrors.163.com/ubuntu precise-proposed main restricted universe multiverse
        #deb-src http://mirrors.163.com/ubuntu precise-backports main restricted universe multiverse
         
        clean http://mirrors.163.com/ubuntu
         
      • 创建本地仓库: su - apt-mirror -c apt-mirror #切换为root用户,否则需要为apt-mirror创建密码(206为mirror)
      •  
      • 清理本地仓库: sudo /bin/bash /mnt/raid5/apt-mirror/var/clean.sh
      •  
      • 配置自动同步本地源: sudo vim /etc/cron.d/apt-mirror #打开注释掉的最后一行
      •  
      • 让本地仓库可通过HTTP访问: sudo ln -sf /mnt/raid5/apt-mirror/mirror/mirrors.163.com/ubuntu/ /var/www/ubuntu
      • 配置客户端源(在个人电脑上)
        cd /etc/apt
        sudo rm sources.list.d/* apt.conf.d/* -rf
        sudo cp sources.list{,.bak}
        #用下面三行替换掉sources.list里的全部内容
        deb [arch=amd64] http://10.0.0.206/ubuntu/ precise main restricted universe multiverse
        deb [arch=amd64] http://10.0.0.206/ubuntu/ precise-updates main restricted universe multiverse
        deb [arch=amd64] http://10.0.0.206/ubuntu/ precise-security main restricted universe multiverse

      • 试试本地源
        sudo apt-get update
  • 相关阅读:
    [C/C++]Fibonacci numbers
    使用VS调试时,被调试进程如何被断下来的。
    Windows下动态加载可执行代码原理简述
    发个JD, 求人被我卖
    使用Windbg知道程序运行时的命令行参数.
    How to debug usermode process using kernelmode windbg in Win7
    This is a test
    多核时代,还在使用任务管理器来看程序的性能吗?
    六种异常处理的陋习
    巧记Java访问控制描述符(Access Control Modifier)public, private, protected
  • 原文地址:https://www.cnblogs.com/457220157-FTD/p/4104194.html
Copyright © 2011-2022 走看看