[原]ubuntu下制作ubuntu源
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
[原]ubuntu下制作ubuntu源的更多相关文章
- [原]ubuntu下制作openstack-havana源
ubuntu下可以用apt-mirror下载openstack的源: 1.安装apt-mirror: apt-get install apt-mirror 2.配置/etc/apt/mirror.li ...
- ubuntu下编译VLC源码
http://blog.csdn.net/beitiandijun/article/details/9225591ubuntu下编译VLC源码 分类: 视频处理 2013-07-02 17:33 57 ...
- Ubuntu下制作deb包的方法详解
1 认识deb包 1.1 认识deb包 deb是Unix系统(其实主要是Linux)下的安装包,基于 tar 包,因此本身会记录文件的权限(读/写/可执行)以及所有者/用户组. 由于 Unix ...
- win7下制作ubuntu系统安装启动盘和U盘安装ubuntu全过程
在我搞坏了两个系统之后,一切都得从头开始了,这回好了,电脑就是一台裸机了.没办法,重新下win7吧.这个要先做一个win7的启动盘,然后再安装,只能说我技术不行,没能把win7搞定.让大神给装的win ...
- Windows环境下制作Ubuntu的U盘启动工具
Windows用户想要尝试一下Ubuntu或其他Linux系统?最简单的方法就是使用VMware Workstation,只是虚拟机会真实占用内存,如果你的电脑内存8G及以上可以试试.内存偏小,或者觉 ...
- win10以及ubuntu下设置pip源
问题描述:有一段时间下载python库的时候速度非常慢,想着提高安装python库的速度. window10下: 一:首先进入c盘的用户目录,如我的目录为C:\Users\felix. 二:创建名为p ...
- Ubuntu下制作窗口
在Ubuntu下安装 sudo apt-get install dialog 类型 用于创建 类型的选项 含义 复选框 --checklist 允许用户显示一个选项列表, 每个选项都可以被单独选择 信 ...
- Ubuntu下制作ISO文件
利用Ubuntu自带的命令mkisofs就可以制作iso文件,具体方法如下: 1. 如果你是直接从cd压制iso文件的,执行 sudo umount /dev/cdromdd if=/dev/cd ...
- ubuntu下导入kali源
Kali-Linux之前的渗透神器BackTrack是基于Ubuntu的,界面比较友好,字体渲染看起来也比较舒服(也可能是本人用惯了 Ubuntu的缘故).后来官方终止BackTrack,开发Kali ...
随机推荐
- python在linux制作图形界面(snack)
snack是一个用于在linux制作图形界面(GUI)的模块,该模块由c编写,而且redhat的系统都自带这个模块. 1.获取模块 虽然redhat系统会自带这个模块,但是直接去import snac ...
- CoreGraphics之CGContext绘图
0 CGContextRef context = UIGraphicsGetCurrentContext(); 设置上下文 1 CGContextMoveToPoint 开始画线 2 CGCon ...
- [转载]C#图片格式(JPG,BMP,PNG,GIF)等转换为ICO图标
using System; using System.Drawing; using System.Windows.Forms; using System.IO; namespace ICOTest { ...
- ANGULAR 2 FOR REACT DEVELOPERS
Now that Angular 2 is in beta, the time has come for us to drop everything and learn something new, ...
- codeforces 390E Inna and Large Sweet Matrix
本题的主要算法就是区间更新和区间求和: 可以用线段树和树状数组来做: 感觉线段树写的太麻烦了,看到官方题解上说可以用树状数组做,觉得很神奇,以前用过的树状数组都是单点维护,区间求和的: 其实树状数组还 ...
- Moloch
http://www.oschina.net/p/moloch maltego http://www.oschina.net/p/maltego
- android 设备唯一码的获取,Cpu号,Mac地址
开发Android应用中,我们常常需要设备的唯一码来确定客户端. Android 中的几中方法,使用中常常不可靠 1. DEVICE_ID 假设我们确实需要用到真实设备的标识,可能就需要用到DEVIC ...
- easyui源码翻译1.32--Pagination(分页)
前言 使用$.fn.pagination.defaults重写默认值对象下载该插件翻译源码 该分页控件允许用户导航页面的数据.它支持页面导航和页面长度选择的选项设置.用户可以在分页控件上添加自定义按钮 ...
- QML嵌入到QWidget中方法
简介 嵌入方法有两种一种是直接拖控件,另一种是cpp代码动态生成, 控件方式 动态代码生成 QQuickWidget *m_quickWidget=new QQuickWidget(); QUrl s ...
- Android EditText多行显示及所有属性
android:id="@+id/editSms" android:layout_width="fill_parent" android:layout_heig ...