对于centos来说,搭建一个本地源,相对来说,还是比较简单的。对于ubuntu来说,就复杂很多,

估计也和我不熟悉有关。

http://unixrob.blogspot.com/2012/05/create-apt-mirror-with-ubuntu-1204-lts.html

上面这个老外的文档,我已经验证了一次,下面是我的过程。

1:安装apt-mirror

这个软件,现在已经在源里,直接安装就可以。

apt-get install apt-mirror

2:设置/etc/apt/mirror.list

装完apt-mirror,就会在/etc/apt/ 目录下产生一个mirror.list 文件。这个文件是需要定制一下。

其实对我来说,我只需要安装64bit的源就可以。不过现在的ubuntu,装完后,运行apt-get update,

他还是需要去找i386的包,所以我需要把ubuntu 12.04 32bit 和64bit的包都下载回来。源码就不下载了。

############# 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  
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

# Precise 64Bit Mirror
deb-amd64 http://cn.archive.ubuntu.com/ubuntu precise main restricted universe multiverse
deb-amd64 http://cn.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
deb-amd64 http://cn.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
deb-amd64 http://cn.archive.ubuntu.com/ubuntu precise-proposed main restricted universe multiverse
deb-amd64 http://cn.archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse

# Precise 32Bit Mirror
deb-i386 http://cn.archive.ubuntu.com/ubuntu precise main restricted universe multiverse
deb-i386 http://cn.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
deb-i386 http://cn.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
deb-i386 http://cn.archive.ubuntu.com/ubuntu precise-proposed main restricted universe multiverse
deb-i386 http://cn.archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse

#deb-src http://cn.archive.ubuntu.com/ubuntu precise main restricted universe multiverse
#deb-src http://cn.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
#deb-src http://cn.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
#deb-src http://cn.archive.ubuntu.com/ubuntu precise-proposed main restricted universe multiverse
#deb-src http://cn.archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse

# Puppet mirror
deb-amd64 http://apt.puppetlabs.com/ precise main
deb-i386 http://apt.puppetlabs.com/ precise main

clean http://cn.archive.ubuntu.com/ubuntu
clean http://apt.puppetlabs.com/

3:开始镜像

apt-mirror /etc/apt/mirror.list

这时候/var/spool/apt-mirror/mirror 下载相应的源。

4:定时更新

默认/etc/cron.d/apt-mirror

如果注释掉,就可以每天都更新。看你的需求,默认是关闭的。

5:客户端使用

由于我是用cobbler来部署ubuntu,可以实现安装的时候,使用本地源,装完系统,默认的源,也是指向本地

apt-mirror的更多相关文章

  1. 在centos中搭建基于nginx的apt源服务器,整合yum源和apt源在一台服务器

    1.首先关闭防护墙或者设置规则通过且关闭selinux 2.nginx-1.14.2版本(编译安装)-自定义安装路径 3.开启nginx目录浏览 以上步骤请参考前文:https://www.cnblo ...

  2. ubuntu下的apt-get内网本地源的搭建

    APT本地源的搭建(可用于局域网apt-get源搭建或者本地源) 本文档介绍使用apt-mirror软件搭建apt本地源 需求:内网开发环境由于其特定原因不能上外网,所以需要本地环境下的内网源来方便开 ...

  3. Ubuntu 各版本代号简介

    起名字是件伤脑筋的事,但是程序猿们似乎最喜欢干伤脑筋的活.Android 的每个版本都有个甜点的别名,而 Ubuntu ,每个版本都有一个更为特色的名字,这个名字由一个形容词和一个动物名称组成,并且, ...

  4. 创建ubuntu软件源

    缘起:虚拟机需要安装一些文件,但是直接从外网下载比较慢,而且安装iso包中是有这些软件的,所以创建一个ubuntu  apt server ubuntu 12.04, 本机192.168.0.124, ...

  5. 使用apt-mirror建立本地debian仓库源

    先介绍一下环境: 主机:Win7 虚拟机:VirtualBox + Debian7 由于软件源的体积比较大,所以我又给虚拟机添加了一块50GB的虚拟硬盘(给虚拟机添加虚拟硬盘的方法参见:http:// ...

  6. 创建本地Ubuntu镜像

    参考文档 http://www.howtoforge.com/local_debian_ubuntu_mirror 安装服务 : sudo apt-get install apt-mirror apa ...

  7. [原]ubuntu下制作openstack-havana源

    ubuntu下可以用apt-mirror下载openstack的源: 1.安装apt-mirror: apt-get install apt-mirror 2.配置/etc/apt/mirror.li ...

  8. 搭建本地Ubuntu 镜像服务器

    一.需求分析 最近公司软件Team 有个需求是这样的:能不能在局域网搭建一个Ubuntu 镜像服务器, 这样作的好处是可以节省Ubuntu某些常用工具的安装时间. 二.部署过程 2.1 测试环境 目前 ...

  9. 制作Ubuntu Kylin局域网源

    国人参与开发的开源操作系统UbuntuKylin(http://www.ubuntukylin.com/)已经发布有一段时间了,一直想在单位的局域网内部用用,可惜离线安装比较麻烦,于是搜索了些如何制作 ...

随机推荐

  1. Mediator 中介者 协调者模式

    简介 定义:用一个[中介者对象]封装一系列的[对象交互],中介者使各对象不需要显示地相互作用,从而使耦合松散,而且可以独立地改变它们之间的交互. 中介者模式的结构 抽象中介者Mediator:定义好[ ...

  2. Poj 3368 Frequent values

    /* 线段树区间合并 维护几个信息 到时候乱搞一下就好了 开始T了 有一种情况可以不用递归 直接算出来 */ #include<iostream> #include<cstdio&g ...

  3. 我的github今天大手笔分享,welcome——fork

    看项目名就知道是什么样子的demo,还包含了数据库文件,welcome fork!

  4. ASP.NET常用编程代码(一)

    1.为按钮添加确认对话框 Button1.Attributes.Add("onclick","return confirm(’确认?’)");button.at ...

  5. 哥的第一个Jquery程序

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs& ...

  6. mssql sql高效关联子查询的update 批量更新

    /* 使用带关联子查询的Update更新     --1.创建测试表 create TABLE Table1     (     a varchar(10),     b varchar(10),   ...

  7. 017_bcp_bulk_openrowset

    017_bcp_bulk_openrowset --bcp*********************************************************************** ...

  8. 开始编写正式的iOS 程序(iOS编程指导)

    App设计基础 在确定了你的App主要功能后,需要把它转化为代码.如果你是第一次开发属于自己的iOS App,需要花些时间熟悉基本概念.iOS内置了很多设计样式,多了解下能对你以后有帮助. 初稿 设计 ...

  9. CSS,点击去除虚线边框代码

  10. ORA-00933 UNION 与 ORDER BY

    原文:http://blog.csdn.net/lwei_998/article/details/6093807 The UNION operator returns only distinct ro ...