欢迎登陆真网站,您的到来是我们的荣幸。 登陆 注册 忘记密码? ☆设为首页 △加入收藏
欢迎加入真幸福QQ群
电脑知识: 基础知识 网络技术 操作系统 办公软件 电脑维修 电脑安全 windows7 windows8 windows10 服务器教程 平板电脑 视频播放教程 网络应用 互联网 工具软件 浏览器教程 QQ技巧 输入法教程 影视制作 YY教程 wps教程 word教程 Excel教程 PowerPoint
云南西双版纳特产小花糯玉米真空包装


找到该死的OutOfMemoryError
Zimbra服务无法正常启动
rsync命令用法
彻底卸载McAfee和Agent的方法
windows下手动配置ipv6地址
FreeBSD配置防火墙开启SSH服务的方法
apache开启.htaccess及.htaccess的使用方法
.htaccess使用方法总结
SUSE Linux Enterprise Server 11 SP1 安装教程图文详解
我来教你玩转iis防盗链 MYIIS-VIF超级防盗链
让内网Ubuntu系统更新更轻松
【 来源:网络 】【 点击:1 】 【 发布时间:2017_03_03 08:59:59 】

   还是起了原来的标题名称,今天在找内网Ubuntu系统更新的方案时,看到了网站上的一篇帖子,很是兴奋。可拿来一看却发现这个apt-proxy的东东已经不在ubuntu 12.04(LTS)的发布版本里了,看来这篇帖子又是有点跟不上潮流的那种。查了一下资料,目前发布版本中提供了approx。官方的描述如下:

  Approx is an HTTP-based proxy server for Debian-style package archives. It fetches files from remote repositories on demand, and caches them for local use.

  Approx saves time and network bandwidth if you need to install or upgrade .deb packages for a number of machines on a local network. Each package is downloaded from a remote site only once, regardless of how many local clients install it. The approx cache typically requires a few gigabytes of disk space.

  Approx also simplifies the administration of client machines: repository locations need only be changed in approx's configuration file, not in every client's /etc/apt/sources.list file.

  Approx can be used as a replacement for apt-proxy, with no need to modify clients' /etc/apt/sources.list files, or as an alternative to apt-cacher.

  approx看来确实是替代了apt-proxy,在10.04之后就不再提供apt-proxy了。

  approx部署起来也是简单至极,首先部署approx:

  sudo apt-get install approx

  通过下边的指令获取当前/etc/apt/sources.list中的更新地址

  $ grep -E "^[^#]" sources.list | cut -d " " -f2 | uniq

  http://au.archive.ubuntu.com/ubuntu/

  http://security.ubuntu.com/ubuntu

  配置/etc/approx/approx.conf文件,添加如下内容

  ubuntu http://cn.archive.ubuntu.com/ubuntu

  ubuntu-extras http://extras.ubuntu.com/ubuntu

  ubuntu-partner http://archive.canonical.com/ubuntu

  ubuntu-security http://security.ubuntu.com/ubuntu

  $ sudo /etc/init.d/openbsd-inetd restart

  * Restarting internet superserver inetd [ OK ]

  重新启动之后,服务就已经在9999端口运行了。

  在客户端的配置,其实就是把客户端的/etc/apt/sources.list文件变更为你approx的地址就可以了:

  deb http://approx:9999/ubuntu/ precise main restricted

  deb-src http://approx:9999/ubuntu/ precise main restricted

  deb http://approx:9999/ubuntu/ precise-updates main restricted

  deb-src http://approx:9999/ubuntu/ precise-updates main restricted

  deb http://approx:9999/ubuntu/ precise universe

  deb-src http://approx:9999/ubuntu/ precise universe

  deb http://approx:9999/ubuntu/ precise-updates universe

  deb-src http://approx:9999/ubuntu/ precise-updates universe

  deb http://approx:9999/ubuntu/ precise multiverse

  deb-src http://approx:9999/ubuntu/ precise multiverse

  deb http://approx:9999/ubuntu/ precise-updates multiverse

  deb-src http://approx:9999/ubuntu/ precise-updates multiverse

  deb http://approx:9999/ubuntu/ precise-backports main restricted universe multiverse

  deb-src http://approx:9999/ubuntu/ precise-backports main restricted universe multiverse

  deb http://approx:9999/ubuntu precise-security main restricted

  deb-src http://approx:9999/ubuntu precise-security main restricted

  deb http://approx:9999/ubuntu precise-security universe

  deb-src http://approx:9999/ubuntu precise-security universe

  deb http://approx:9999/ubuntu precise-security multiverse

  deb-src http://approx:9999/ubuntu precise-security multiverse

  其他地址就可以删除掉了。剩下的就是sudo apt-get update ~~~

本网站由川南居提供技术支持,fkzxf版权所有 浙ICP备12031891号
淳安分站 淳安分站