[原]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学习_Python 3.X版本导入httplib模块报ImportError解决方案
之前用Python 2.7版本的httplib做接口测试时,运行代码都是正常的, 最近开始用Python 3.3之后,再去看以前的代码,发现import httplib出现错误:Unresolved ...
- WPF杂难解 奇怪的DisconnectedItem
简单场景: 列表绑定后台数据,点击列表项在view的cs中拿点击项的DataContext进一步处理.正常情况下应该是能拿到我绑定上去的数据,但是偶尔会点出来DisconnectedItem,重现几率 ...
- poj 3250 Bad Hair Day 单调栈入门
Bad Hair Day 题意:给n(n <= 800,000)头牛,每头牛都有一个高度h,每头牛都只能看到右边比它矮的牛的头发,将每头牛看到的牛的头发加起来为多少? 思路:每头要进栈的牛,将栈 ...
- hdu 3944 DP? 组合数取模(Lucas定理+预处理+帕斯卡公式优化)
DP? Problem Description Figure 1 shows the Yang Hui Triangle. We number the row from top to bottom 0 ...
- Sublime Text 3之Package Control 安装
1.通过快捷键 ctrl+` 或者 View > Show Console 打开控制台,然后粘贴以下安装代码: import urllib.request,os; pf = 'Package C ...
- CSS 居中方法集锦(*******************************)
记录收集纯CSS层面实现的水平.垂直居中方法可用于块级.行内快.内联元素以及文字图片等. 水平或垂直居中 1.1 text-align1.2 margin1.3 line-height1.4 pa ...
- 肾果手机App Store切换区域(无需Visa或者万事达)
8月份在肾果官网买了个touch6,有时候需要换区去墙外下载app,然而一个个国家都要输入Visa或者万事达卡...今天终于找到一个不用输入信用卡号的区域:Canada!!! 办法(适用于8.X,7. ...
- jquery and event
jquery阻止事件冒泡 event.stopPropagation(); event.cancelBubble = true; jquery阻止默认操作 event.preventDefault() ...
- Java Web 前端高性能优化(一)
Web 发展的速度让许多人叹为观止,层出不穷的组件.技术,只需要合理的组合.恰当的设置,就可以让 Web 程序性能不断飞跃.所有 Web 的思想都是通用的,它们也可以运用到 Java Web.这一系列 ...
- JavaScript 按回车键提交搜索表单 easyui ajax方式
<!-- 搜索框 --> <form id="bUserSearchForm" style="padding:8px;" onkeydown= ...