我是靠谱客的博主 高挑滑板,最近开发中收集的这篇文章主要介绍获取镜像源来搭建本地Ubuntu14.04源,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

针对公司的网络限制,可以在局域网内搭建一台本地的ubuntu源。
1、修改源配置,换成搜狐源(默认的ubuntu源不如某些国内的源速度快)
vi /etc/apt/source.list

deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multivers
2、安装apt-mirror工具
apt-get install -y apt-mirror
3、配置apt-mirror工具
vi /etc/apt/mirrors.list
这里只下载了64位的二进制文件

set nthreads 20
set _tilde 0
deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
clean http://mirrors.sohu.com/ubuntu
4、开始下载,速度取决于网速(大概有75G)
apt-mirror
5、作为本机源
源路径在 /var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu
vi /etc/apt/sources.list

deb file:///var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu trusty main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu trusty-security main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu trusty-updates main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu trusty-proposed main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu trusty-backports main restricted universe multiverse
6、作为局域网源
安装apache2
apt-get install apache2
将镜像目录链接到apache2的根目录(/var/www/html/)下
ln -s /var/spool/apt-mirror/mirror/mirrors.sohu.com/ubuntu /var/www/html/ubuntu
7、修改局域网ubuntu内源配置为该主机ip
vi /etc/apt/sources.list

deb http://x.x.x.x/ubuntu trusty main restricted universe multiverse
deb http://x.x.x.x/ubuntu trusty-security main restricted universe multiverse
deb http://x.x.x.x/ubuntu trusty-updates main restricted universe multiverse
deb http://x.x.x.x/ubuntu trusty-proposed main restricted universe multiverse
deb http://x.x.x.x/ubuntu trusty-backports main restricted universe multiverse

最后

以上就是高挑滑板为你收集整理的获取镜像源来搭建本地Ubuntu14.04源的全部内容,希望文章能够帮你解决获取镜像源来搭建本地Ubuntu14.04源所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(103)

评论列表共有 0 条评论

立即
投稿
返回
顶部