快速搭建Ubuntu更新源服务器
2016-06-06 10:08
274 查看
from:http://blog.csdn.net/robertsong2004/article/details/37954691
在公司学校,经常有需要在本地架设一台Ubuntu源服务器。
可以通过下面这个简单的步骤来设定。
1.
这里我们使用一台装有ubuntu 的PC做server.
1.1.
$ sudo apt-get install apache2
$ sudo apt-get install apt-mirror
1.2.
整个repo非常大,我们可以对mirror.list做一些修改,只选择一部分的软件包。
如下所示:
deb http://archive.ubuntu.com/ubuntu precise main restricted universe
然后执行:
$ sudo apt-mirror
1.4.
$ cd /var/www
$ sudo ln -s /var/spool/apt-mirror/skel/archive.ubuntu.com/ubuntu
1.5.
$ sudo service apache2 restart
这样服务端就配好了。
deb http://192.168.1.2/ubuntu/ precise main restricted universe
deb-src http://192.168.1.2/ubuntu/ precise main restricted universe
这里192.168.1.2是服务器的IP
在公司学校,经常有需要在本地架设一台Ubuntu源服务器。
可以通过下面这个简单的步骤来设定。
1.
服务器端的配置
这里我们使用一台装有ubuntu 的PC做server.1.1.
安装 对应的软件包
$ sudo apt-get install apache2$ sudo apt-get install apt-mirror
1.2.
执行 apt-mirror
整个repo非常大,我们可以对mirror.list做一些修改,只选择一部分的软件包。如下所示:
deb http://archive.ubuntu.com/ubuntu precise main restricted universe
然后执行:
$ sudo apt-mirror
1.4.
创建ubuntu目录
$ cd /var/www$ sudo ln -s /var/spool/apt-mirror/skel/archive.ubuntu.com/ubuntu
1.5.
重启http服务
$ sudo service apache2 restart这样服务端就配好了。
2. 客户端的配置
同样,由于客户端需要连到我们配好的服务器上,客户端这边也要做相应的调整。2.1. 修改 /etc/apt/souces.list
注释掉所有其他的repository, 追加下面两行:deb http://192.168.1.2/ubuntu/ precise main restricted universe
deb-src http://192.168.1.2/ubuntu/ precise main restricted universe
这里192.168.1.2是服务器的IP
2.2. 更新对应的信息
sudo apt-get update相关文章推荐
- Linux socket 初步
- Linux Kernel 4.0 RC5 发布!
- linux lsof详解
- linux 文件权限
- Linux 执行数学运算
- 10 篇对初学者和专家都有用的 Linux 命令教程
- Linux 与 Windows 对UNICODE 的处理方式
- Ubuntu12.04下QQ完美走起啊!走起啊!有木有啊!
- 解決Linux下Android开发真机调试设备不被识别问题
- 运维入门
- 运维提升
- Linux 自检和 SystemTap
- Ubuntu Linux使用体验
- c语言实现hashmap(转载)
- Linux 信号signal处理机制
- linux下mysql添加用户
- Scientific Linux 5.5 图形安装教程
- Linux 下无损图片压缩小工具介绍