linux ubuntu 本地镜像 软件源 制作方法
1、配置当前软件源,镜像非常大,所以首先要配置一下载速度快的软件源http://fffo.blog.163.com/blog/static/2119130682014322104136601/2、安装镜像软件 并 修改镜像参数文件
1)、安装apt-mirror
sudo apt-get install apt-mirror
2)、修改mirror.list
http://www.linuxidc.com/Linux/2014-08/105415.htm
sudo gedit /etc/apt/mirror.list
文件内容如下:
——————————————引用开始——————————————————
############# config ##################
#
# set base_path /var/spool/apt-mirror [镜像存放目录位置,可根据磁盘容量情况进行更改]
#
# if you change the base path you must create the directories below with write privileges
#
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
set nthreads 3 [下载进程,默认20,建议3]
set _tilde 0
#
############# end config ##############
deb http://archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jaunty-proposed main restricted universe multiverse
deb http://archive.ubuntu.org.cn/ubuntu-cn/ jaunty main restricted universe multiverse
[需要进行镜像的APT软件源地址,选择速度较快的官方源或国内源]
#deb-src http://archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu jaunty-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu jaunty-backports main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu jaunty-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu jaunty-proposed main restricted universe multiverse
[不需要源代码,用#进行地址屏蔽]
clean http://archive.ubuntu.com/ubuntu
clean http://archive.ubuntu.org.cn/ubuntu-cn
[镜像完成后对本地镜像和软件源进行比较]
——————————————引用结束——————————————————
3、创建镜像根目录
mkidr /var/spool/apt-mirror
4、开始镜像(支持断点续传,任何中断都不会照成影响)
1)sudo apt-mirror
定时执行上面的命令,可以达到定时同步远程仓库的效果
2)完成镜像后进行清理多余文件
sudo /var/spool/apt-mirror/var/clean.sh
5、使用本地源
cd /etc/apt
sudo mv source.list source.list.bak
sudo vim source.list
加入如下内容
deb file:///var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ jaunty main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ jaunty-backports restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ jaunty-proposed main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ jaunty-security main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ jaunty-updates main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/archive.ubuntu.org.cn/ubuntu-cn/ jaunty main restricted universe multiverse
6、发布到局域网
1)安装Apache2
sudo apt-get install apache2
2)建立符号连接,将镜像与Apache虚拟目录联系起来
sudo ln -s /var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu/ /var/www/html/ubuntu
3)局域网中每个用户,修改sources.list文件
cd /etc/apt
sudo cp sources.list sources.list.bak
sudo vim source.list
加入如下内容
deb http://192.168.0.10/ubuntu jaunty main restricted universe multiverse
deb http://192.168.0.10/ubuntu jaunty-backports restricted universe multiverse
deb http://192.168.0.10/ubuntu jaunty-proposed main restricted universe multiverse
deb http://192.168.0.10/ubuntu jaunty-security main restricted universe multiverse
deb http://192.168.0.10/ubuntu jaunty-updates main restricted universe multiverse
deb http://192.168.0.10/ubuntu-cn jaunty main restricted universe multiverse
linux ubuntu 本地镜像 软件源 制作方法的更多相关文章
- linux centos&Ubuntu&RedHat更换软件源
linux三大版本更换软件源 前排提示,有的源可能已经失效,如果发现请留言或自行寻找其他源. 1.centos mv /etc/yum.repos.d/CentOS-Base.repo [--path ...
- 创建本地yum软件源,为本地Package安装Cloudera Manager、Cloudera Hadoop及Impala做准备
一.包管理工具及CentOS的yum 1.包管理工具如何发现可以用的包 包管理工具依赖一系列软件源,工具下载源的信息存储在配置文件中,其位置随某包管理工具不同而变化 使用yum的RedHat/Cent ...
- ubuntu修改软件源的方法
最快方法--替换法 刚安装好的ubutun,打开source.list后,用vim替换的方法将所有的us提付出替换为 cn,然后保存退出,更新即可. # vim /etc/apt/source.lis ...
- [linux]ubuntu修改镜像源
sudo apt-get update 更新源 sudo apt-get install package 安装包 sudo apt-get remove package 删除包 sudo apt-ca ...
- 韦东山linux学习之ubuntu 9.10 软件源 问题
跟着开发板视频学习,安装了ubuntu9.10,然而由于现在官方已经不再提供软件更新的服务,软件我一直安装不上,搞了两天终于解决了. 一.安装VMware,配置等等就不详细说了,安装好系统后,网能连上 ...
- UBUntu 软件 源配置方法
近期公司产品须要添加一个功能,就是版本号自己主动更新.使用apt-get 实现. apt-get 软件源配置的方法,參见本人资源里的共享.以下是代码中作为升级的一部分. FILE *fp; ...
- Ubuntu系统的软件源更换
参考:https://www.daweibro.com/node/142 什么是Ubuntu的软件源? 我们在使用Debian或者Ubuntu的apt-get工具来安装需要的软件时,其实就是从服务器获 ...
- ubuntu 16.04软件源
来源:模板:16.04source deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multive ...
- ubuntu修改163软件源
cd /etc/apt cat sources.list sudo su root sudo echo '' > sources.list nano sources.list 复制163软件源 ...
随机推荐
- Vue-router的基本使用
Vue-router的基本使用 相关Html: <!DOCTYPE html> <html lang="en"> <head> <meta ...
- [转]SQL的主键和外键约束
SQL的主键和外键的作用: 外键取值规则:空值或参照的主键值. (1)插入非空值时,如果主键表中没有这个值,则不能插入. (2)更新时,不能改为主键表中没有的值. (3)删除主键表记录时,你可以在建外 ...
- GridSearchCV
GridSearchCV 简介: GridSearchCV,它存在的意义就是自动调参,只要把参数输进去,就能给出最优化的结果和参数.但是这个方法适合于小数据集,一旦数据的量级上去了,很难得出结果.这个 ...
- 软件级负载均衡器(LVS/HAProxy/Nginx)的特点简介和对比
本文出自 “抚琴煮酒” 博客,出处http://andrewyu.blog.51cto.com/1604432/697466 现在网站发展的趋势对网络负载均衡的使用是随着网站规模的提升根据不同的阶 ...
- ruby大神与菜鸟的代码区别
之前Brand类 has_and_belongs_to_many :categories, index: true 现在在Category类 增加 has_and_belongs_to_many ...
- 如何找出长时间未提交的事务session ID
收到报警某台mysql数据库慢查询数量超过5,登录上去看,发现阻塞的SQL全部是update,处于Updating状态 +---------+------+-----------+------+--- ...
- asdfasdfasdfasdf
- CodeBlocks "no such file or directory" 错误解决方案(创建类找不到头文件)
在CodeBlocks下,有时候需要自己定义类,当然就要添加相应的头文件,但添加进去的头文件明明包含在项目中了, 但编译时还是会报错:no such file or directory;这是为什么呢? ...
- FineUI分组显示弹框最新的在最上边
function TOBTCorrFun(obj){ var msgContent = JSON.parse(obj.dataJson); var tJson = JSON.stringify(obj ...
- 【转】手机web前端调试页面的几种方式
前言 PC端web页面调试比较容易,这里主要说几种移动端调试的方法,从简单到复杂.从模拟调试到远程调试,大概分为几部分: 1.Chrome DevTools(谷歌浏览器)的模拟手机调试 2.weinr ...