ubuntu下可以用debmirror来下载ubuntu的所有源:

配置ubuntu12.04_mirror.sh

 ###########################################################################
## ##
## Ubuntu Mirror Script ##
## ##
## Creation: 06.07. ##
## Last Update: 02.06. ##
## ##
## Copyright (c) - by Georg Kainzbauer <georgkainzbauer@gmx.net> ##
## ##
## This program is free software; you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation; either version of the License, or ##
## (at your option) any later version. ##
## ##
###########################################################################
#!/bin/sh # Ubuntu mirror server and mirror directory
#SOURCE_SRV=cn.archive.ubuntu.com
#SOURCE_SRV=archive.ubuntu.com
SOURCE_SRV=cn.archive.ubuntu.com
SOURCE_DIR=/ubuntu # Distribution, section and architecture list
DIST=precise,precise-security,precise-updates,precise-backports,precise-proposed
SECTION=main,main/debian-installer,main/i18n,main/dist-upgrader-all,main/installer-amd64,main/installer-i386,main/uefi,restricted,restricted/debian-installer,restricted/i18n,universe,universe/debian-installer,universe/i18n,multiverse,multiverse/debian-installer,multiverse/i18n
ARCH=i386,amd64 # Local mirror directory
#MIRRORDIR=/var/ftp/pub/linux/ubuntu/
MIRRORDIR=/home/ubuntu/ # Log file
LOGFILE=/var/log/ubuntu_mirror.log # Debug file (if you do not want to debug the download process set this option to "/dev/null")
DEBUGFILE=/var/log/ubuntu_mirror.debug # Who will be informed in case if anything goes wrong (if you do not want to be informed via mail, set this option to "")
#MAILNOTIFY="root@localhost" # Lock file
LOCK=/var/tmp/ubuntu_mirror.lock ##################################################################
# NORMALY THERE IS NO NEED TO CHANGE ANYTHING BELOW THIS COMMENT #
################################################################## function log()
{
echo `date +%d.%m.%Y%t%H:%M:%S` " LOG:" $ >>${LOGFILE}
} function error()
{
echo `date +%d.%m.%Y%t%H:%M:%S` " ERROR:" $ >>${LOGFILE}
if [ -n "$MAILNOTIFY" ] ; then
echo `date +%d.%m.%Y%t%H:%M:%S` " ERROR:" $ | mail -s "ERROR while synchronizing Ubuntu" $MAILNOTIFY
fi
echo $ | grep "Lockfile" >/dev/null
if [ $? = ] ; then
rm -f ${LOCK}
fi
exit
} function status()
{
case "$1" in
)
log "Synchronization completed."
;;
)
error "DEBMIRROR: Connection closed"
;;
)
error "DEBMIRROR: Timeout"
;;
*)
error "DEBMIRROR: Unknown error $1"
;;
esac
} if [ -f ${LOCK} ] ; then
error "Lockfile ${LOCK} exists."
fi touch ${LOCK} # Create local mirror directory if not exists
if [ ! -d ${MIRRORDIR} ] ; then
log "Creating local mirror directory."
mkdir -p ${MIRRORDIR}
fi log "Starting Ubuntu download process."
debmirror -v -e http -h ${SOURCE_SRV} -r ${SOURCE_DIR} --ignore-release-gpg --dist=${DIST} --section=${SECTION} --arch=${ARCH} ${MIRRORDIR} >> ${DEBUGFILE} >&
status $? rm -f ${LOCK} exit

3、执行脚本,下载ubuntu包:

nohup bash ubuntu12.04_mirror.sh &

下载的包会放在指定的目录中:/home/ubuntu

4、安装apache2:

apt-get install apache2

5、把ubuntu包路径放到apache:

ln -s /home/ubuntu /var/www

6、客户端配置:

mv /etc/apt/source.list /etc/apt/source.list.bak

vim /etc/apt/source.list

 deb http://ip/ubuntu/ precise main restricted universe multiverse

 deb-src http://ip/ubuntu/ precise main restricted universe multiverse

 deb http://ip/ubuntu/ precise-updates main restricted universe multiverse

 deb-src http://ip/ubuntu/ precise-updates main restricted universe multiverse

 deb http://ip/ubuntu/ precise-backports main restricted universe multiverse

 deb-src http://ip/ubuntu/ precise-backports main restricted universe multiverse

 deb http://ip/ubuntu/ precise-security main restricted universe multiverse

 deb-src http://ip/ubuntu/ precise-security main restricted universe multiverse

7、测试:

客户端:apt-get update

作者:yuandianlws 发表于2014-1-23 15:29:45 原文链接
阅读:46 评论:0 查看评论

[原]ubuntu下制作ubuntu源的更多相关文章

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

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

  2. ubuntu下编译VLC源码

    http://blog.csdn.net/beitiandijun/article/details/9225591ubuntu下编译VLC源码 分类: 视频处理 2013-07-02 17:33 57 ...

  3. Ubuntu下制作deb包的方法详解

    1  认识deb包 1.1   认识deb包 deb是Unix系统(其实主要是Linux)下的安装包,基于 tar 包,因此本身会记录文件的权限(读/写/可执行)以及所有者/用户组. 由于 Unix ...

  4. win7下制作ubuntu系统安装启动盘和U盘安装ubuntu全过程

    在我搞坏了两个系统之后,一切都得从头开始了,这回好了,电脑就是一台裸机了.没办法,重新下win7吧.这个要先做一个win7的启动盘,然后再安装,只能说我技术不行,没能把win7搞定.让大神给装的win ...

  5. Windows环境下制作Ubuntu的U盘启动工具

    Windows用户想要尝试一下Ubuntu或其他Linux系统?最简单的方法就是使用VMware Workstation,只是虚拟机会真实占用内存,如果你的电脑内存8G及以上可以试试.内存偏小,或者觉 ...

  6. win10以及ubuntu下设置pip源

    问题描述:有一段时间下载python库的时候速度非常慢,想着提高安装python库的速度. window10下: 一:首先进入c盘的用户目录,如我的目录为C:\Users\felix. 二:创建名为p ...

  7. Ubuntu下制作窗口

    在Ubuntu下安装 sudo apt-get install dialog 类型 用于创建 类型的选项 含义 复选框 --checklist 允许用户显示一个选项列表, 每个选项都可以被单独选择 信 ...

  8. Ubuntu下制作ISO文件

    利用Ubuntu自带的命令mkisofs就可以制作iso文件,具体方法如下: 1.   如果你是直接从cd压制iso文件的,执行 sudo umount /dev/cdromdd if=/dev/cd ...

  9. ubuntu下导入kali源

    Kali-Linux之前的渗透神器BackTrack是基于Ubuntu的,界面比较友好,字体渲染看起来也比较舒服(也可能是本人用惯了 Ubuntu的缘故).后来官方终止BackTrack,开发Kali ...

随机推荐

  1. map遍历的三种基础用法

    java中遍历MAP的几种方法 Java代码 Map<String,String> map=new HashMap<String,String>();    map.put(& ...

  2. 微信支付JS API使用心得

    微信的接口真的很坑爹,只返回成功或失败,从来不会告诉你为什么失败.这个微信支付的js接口也是调了一个下午才成功,期间踩了不少坑,在这里总结一下,而且把支付接口封装成了一个js文件,这样以后调用就很方便 ...

  3. iis认证方式

    http://msdn.microsoft.com/en-us/library/aa302377.aspx

  4. JAVA TCP/IP Socket通信机制以及应用

    关于局域网通信(同一wifi下,自己电脑当服务端,同一网络段) 1.例如192.168.1.x,只有x位不相同视为同一网络段 2.当具备了以上条件,即可编写服务端代码,服务端的机制. 3.Server ...

  5. 使用struts2标签<s:action无法显示引用页面问题

    使用过程中参考:http://www.cnblogs.com/lihuiyy/archive/2012/03/23/2411601.html 个人使用: 1.引用页面 <s:action nam ...

  6. js正则匹配查找

    var pattern1 = /好/g; console.log(pattern1.test("你好")); 字符串查找: var pattern1 = /\w/; console ...

  7. MySQL db优化

    http://blog.csdn.net/likika2012/article/details/38816037 http://www.nowamagic.net/librarys/veda/deta ...

  8. Delphi实现多个图像相互覆盖时无内容处点击穿透

    http://www.52delphi.com/list.asp?ID=1405 CM_HITTEST是Delphi自定义的控件消息

  9. php 中奖概率算法

    我们先完成后台PHP的流程,PHP的主要工作是负责配置奖项及对应的中奖概率,当前端页面点击翻动某个方块时会想后台PHP发送ajax请求,那么后台PHP根据配置的概率,通过概率算法给出中奖结果,同时将未 ...

  10. Awesomplete 屌爆了

    自动完成,功能强大! 具体请参考 http://leaverou.github.io/awesomplete