ubuntu16.04 自建源
apt-get install apt-mirror
2、修改apt-mirror配置文件
vim /etc/apt/mirror.list


参考以下配置文件:
清空原有的配置文件,直接使用以下配置文件即可
############# config ##################
# 以下注释的内容都是默认配置,如果需要自定义,取消注释修改即可
set base_path /var/spool/apt-mirror
#
# 镜像文件下载地址
# set mirror_path $base_path/mirror
# 临时索引下载文件目录,也就是存放软件仓库的dists目录下的文件(默认即可)
# set skel_path $base_path/skel
# 配置日志(默认即可)
# set var_path $base_path/var
# clean脚本位置
# set cleanscript $var_path/clean.sh
# 架构配置,i386/amd64,默认的话会下载跟本机相同的架构的源
set defaultarch amd64
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
# 下载线程数
set nthreads 20
set _tilde 0
#
############# end config ##############
# Ali yun(这里没有添加deb-src的源)
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse clean http://mirrors.aliyun.com/ubuntu


3、开始同步
执行 apt-miiror
然后等待很长时间(该镜像差不多100G左右,具体时间看网络环境),同步的镜像文件目录为/var/spool/apt-mirror/mirror/mirrors.aliyun.com/ubuntu/,当然如果增加了其他的源,在/var/spool/apt-mirror/mirror目录下还有其他的地址为名的目录。
注意:当apt-mirror 被意外中断时,只需要重新运行即可,apt-mirror支持断点续存;另外,意外关闭,需要在/var/spool/apt-mirror/var目录下面删除 apt-mirror.lock文件【 sudo rm apt-mirror.lock 】,之后执行apt-mirror重新启动
apt-get install apache2
由于Apache2的默认网页文件目录位于/var/www/html,因此,可以做个软链接(这样我们就可以直接访问了,无需将其直接导入该目录)
ln -s /var/spool/apt-mirror/mirror/mirrors.aliyun.com/ubuntu /var/www/html/ubuntu
http://[host]:[port]/ubuntu #ip和port是自己本机的,其中端口默认为80
在测试时可能遇到打不开的情况,查看下iptables规则是否限制或者selinux的问题(这点相信大家在学习lanmp的时候都已经了解过了)


# Local Source #ip和port是自己本机的,其中端口默认为80
deb [arch=amd64] http://[host]:[port]/ubuntu/ trusty main restricted universe multiverse
deb [arch=amd64] http://[host]:[port]/ubuntu/ trusty-security main restricted universe multiverse
deb [arch=amd64] http://[host]:[port]/ubuntu/ trusty-updates main restricted universe multiverse
deb [arch=amd64] http://[host]:[port]/ubuntu/ trusty-proposed main restricted universe multiverse
deb [arch=amd64] http://[host]:[port]/ubuntu/ trusty-backports main restricted universe multiverse


2、更新apt-get源
apt-get update #这步很重要
apt-get upgrade
ubuntu16.04 自建源的更多相关文章
- ubuntu16.04更换镜像源
1.备份原有 cp /etc/apt/sources.list /etc/apt/sources.list.old 2.打开阿里巴巴镜像源: https://opsx.alibaba.com/mir ...
- Ubuntu16.04常用软件源
这篇博文的,主要目的是为了方便我和大家安装软件.我将我安装过的所有软件包的源列在此处. Google Chrome sudo wget https://repo.fdzh.org/chrome/goo ...
- Ubuntu16.04阿里云源
16.04源 deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://m ...
- Ubuntu16.04 国内更新源
在修改source.list之前要先备份 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 替换内容到source.list中 阿里云源: ...
- Ubuntu16.04 换阿里源
国内阿里源速度比较快,北京联通下载极快.更新也比较稳定 1.备份 cp /etc/apt/source.list /etc/apt/source.list.bak 2.编辑source文件 sudo ...
- Ubuntu16.04 / OpenCV / Python 源码安装
为什么需要源码安装? 1. 对 Python 版的 OpenCV,Ubuntu 有两种安装方式: 源码安装:官网(https://opencv.org/releases.html)下载源代码,在机器上 ...
- Ubuntu16.04更换下载源
更新源的方法 进入/etc/apt/ cd /etc/apt 对 sources.list文件进行备份: sudo cp sources.list sources.list.bak 打开源列表文件 s ...
- 解决 Ubuntu16.04 + opencv4.1 源码编译错误 Makefile:160: recipe for target 'all' failed
最近源码编译 opencv,出现下面的错误 [ %] Built target opencv_dnn Makefile:: recipe for target 'all' failed google ...
- Ubuntu16.04系统Tensorflow源码安装
最近学习Tensorflow,记录一下安装过程.目前安装的是CPU版的 1.下载tensorflow源码 tensorflow是个开源库,在github上有源码,直接在上面下载.下载地址:https: ...
随机推荐
- python条件判断语句
# 条件判断(if)语句: # 语法1: if 条件表达式 : 单行语句 # 语法2: if 条件表达式 : # 代码块(多行语句) # 执行的流程:if语句在执行时,会先对条件表达式进行求值判断, ...
- 倍增笔记ST表
https://noip-1253948194.cos.ap-beijing.myqcloud.com/%E5%80%8D%E5%A2%9E-ST%E7%AE%97%E6%B3%95.mp4 1123 ...
- java面试题-spring篇
这次是关于spring的面试题,和上次一样依旧挑了几个具有代表性的. 一. 谈谈你对 Spring 的理解 Spring 是一个开源框架,为简化企业级应用开发而生.Spring 可以是使简单的 Ja ...
- mysql 自增
auto_increment 在创建表的时候,可以设置id为自增 # 查看表现在的自增值 show create table blog \G; # 设置自增值的初始值 alter table blog ...
- 个人任务day6
今日计划: 学会将网页放到公用网络上,并生成快捷方式. 昨日成果:完成登录页面.
- 10、python函数
前言:本文主要介绍python函数的定义和调用.函数的参数.函数的作用域.内置函数. 一.函数的定义和调用 1.函数的作用 对特定的一些功能进行封装,提高代码的重用率,进而提升开发的效率,格式: de ...
- ContractPattern 面向面向契约模式
- 创建dynamics CRM client-side (七) - 用JS 来控制Auto-Save
在我们的system setting里面, 我们可以设置打开/关闭 auto save的功能. 我们可以用js来控制auto-save this.formOnSave = function (exec ...
- 使用dlib自带的面向梯度直方图(HOG)和线性分类器方法来检测人脸
之前使用opencv里面CascadeClassifier(级联分类器)来识别人脸, 下面使用dlib库来实现人脸识别. dlib是一个开源的库,它包含了很多内容有机器学习,图像处理,数值算法等等. ...
- 大事务造成的延迟(从binlog入手分析)
log_event.cc 入口: int Query_log_event::do_apply_event(Relay_log_info const *rli,const char *query_arg ...