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. Centos 7 通过YUM安装 PHP7 NGINX1.1.8 POSTGRESQL9.5

    转载 1.最小化安装CENTOS7 2.更新源: yum update reboot 3.安装扩展源: yum install epel-release 4.安装工具软件: yum install w ...

  2. 长达半年的苹果发布会:亮点与槽点(iPhone5s,iPhone5c)

    不知出于什么原因,今天凌晨召开的苹果发布会并没有视频直播,所以大家都守着The Verge家的图文直播.结果,苹果再一次用事实证明了他们没有保密体系,或者,故意没有保密体系. 整场发布会正经的亮点如下 ...

  3. WiFi与WLAN的区别

    很多人到了某一个地方首选要找的就是无线网络,有时候还会问周围的人:这里有WiFi吗?或者说:这里有WLAN吗?那WiFi和WLAN有什么区别呢? 简单来讲,WiFi是无线保真(wireless fid ...

  4. 使用WampServer 3.0

    在server上安装了WampServer 发现本地使用良好,但是无法从别的PC访问. 原因有二: 1.现象:输入连接无反应 原因:server本身用了80端口,所有WampServer我就设置了80 ...

  5. hdu 3715

    一个很简单的2-sat的题: 不过比较难想到: 其实也不是很难,可能接触的少了吧! #include<cstdio> #include<vector> #define maxn ...

  6. POJ1269+直线相交

    求相交点 /* 线段相交模板:判相交.求交点 */ #include<stdio.h> #include<string.h> #include<stdlib.h> ...

  7. ruby 线程学习

    i=1 Thread.start{ while true print "Thread 1 \n" i+=1 if i==5 then Thread.kill Thread.curr ...

  8. Layout Resource官方教程(1)简介

    Layout Resource SEE ALSO Layouts A layout resource defines the architecture for the UI in an Activit ...

  9. android:process为耗资源操作指定一个新进程

    当有一些耗费内存比较多的操作时,可以通过android:process指定一个新的进程.保证程序运行. 例如: 一个后台长期运行的service: <service android:name=& ...

  10. FileSystemWatcher使用方法

    FileSystemWatcher控件主要功能: 监控指定文件或目录的文件的创建.删除.改动.重命名等活动.可以动态地定义需要监控的文件类型及文件属性改动的类型. 1.常用的几个基本属性: (1) P ...