Установка и настройка approx

Приспичило мне обновить детские машины до последней версии дистрибутива, но мы используем неявный прокси и задача стала нетривиальной. Выход, как всегда, был найден неожиданно — с помощью approx.

Approx имитирует HTTP-репозиторий Debian. При получении от компьютера локальной сети запроса на загрузку какого-либо пакета последний загружается с настоящего репозитория и сохраняется в кеше (соответственно, в следующий раз пакет выдаётся из кеша).

Approx позволяет сэкономить время и внешний трафик при установке или обновлении систем Debian на нескольких компьютерах в локальной сети. Кеш пакетов обычно занимает несколько ГБ.

Approx также некоторым образом упрощает администрирование клиентских систем: при изменении адресов реальных репозиториев в клиентских файлах /etc/apt/sources.list никаких изменений выполнять не нужно.

На сервере

  • Установим approx:
    apt-get install approx

  • Следующим шагом открываем в редакторе файл /etc/approx/approx.conf и добавляем в самое начало файла описания репозиториев:

    approx.conf
    # Here are some examples of remote repository mappings.
    # See http://www.debian.org/mirror/list for mirror sites.
     
    debian  	http://ftp.debian.org/debian
    security	http://security.debian.org/debian-security
    volatile	http://volatile.debian.org/debian-volatile
     
    ubuntu		http://ua.archive.ubuntu.com/ubuntu
    ubuntu-security	http://security.ubuntu.com/ubuntu
    archive		http://archive.canonical.com/ubuntu
    extras		http://extras.ubuntu.com/ubuntu
    # gimp		http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu
     
    # The following are the default parameter values, so there is
    # no need to uncomment them unless you want a different value.
    # See approx.conf(5) for details.
     
    #$cache		/var/cache/approx
    #$max_rate	unlimited
    #$max_redirects 5
    #$user		approx
    #$user	root
    #$group	root
    #$group		approx
    #$syslog	daemon
    #$pdiffs	true
    #$offline	false
    #$max_wait	10
    #$verbose	false
    #$debug		false

На клиентах

  • Изменяем /etc/apt/sources.list на локальных ПК:
    sources.list
    # deb cdrom:[Ubuntu 12.04.1 LTS _Precise Pangolin_ - Release i386 (20120817.1)]/ precise main restricted
     
    # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    # newer versions of the distribution.
    #deb http://ua.archive.ubuntu.com/ubuntu/ precise main restricted
    deb http://approx.liceum.lan:9999/ubuntu/ precise main restricted
    # deb-src http://ua.archive.ubuntu.com/ubuntu/ precise main restricted
     
    ## Major bug fix updates produced after the final release of the
    ## distribution.
    #deb http://ua.archive.ubuntu.com/ubuntu/ precise-updates main restricted
    deb http://approx.liceum.lan:9999/ubuntu/ precise-updates main restricted
    # deb-src http://ua.archive.ubuntu.com/ubuntu/ precise-updates main restricted
     
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team. Also, please note that software in universe WILL NOT receive any
    ## review or updates from the Ubuntu security team.
    deb http://approx.liceum.lan:9999/ubuntu/ precise universe
    # deb-src http://ua.archive.ubuntu.com/ubuntu/ precise universe
    deb http://approx.liceum.lan:9999/ubuntu/ precise-updates universe
    # deb-src http://ua.archive.ubuntu.com/ubuntu/ precise-updates universe
     
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
    ## team, and may not be under a free licence. Please satisfy yourself as to 
    ## your rights to use the software. Also, please note that software in 
    ## multiverse WILL NOT receive any review or updates from the Ubuntu
    ## security team.
    deb http://approx.liceum.lan:9999/ubuntu/ precise multiverse
    # deb-src http://ua.archive.ubuntu.com/ubuntu/ precise multiverse
    deb http://approx.liceum.lan:9999/ubuntu/ precise-updates multiverse
    # deb-src http://ua.archive.ubuntu.com/ubuntu/ precise-updates multiverse
     
    ## N.B. software from this repository may not have been tested as
    ## extensively as that contained in the main release, although it includes
    ## newer versions of some applications which may provide useful features.
    ## Also, please note that software in backports WILL NOT receive any review
    ## or updates from the Ubuntu security team.
    # deb http://ua.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
    # deb-src http://ua.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
     
    deb http://approx.liceum.lan:9999/ubuntu-security/ precise-security main restricted
    # deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
    deb http://approx.liceum.lan:9999/ubuntu-security/ precise-security universe
    # deb-src http://security.ubuntu.com/ubuntu precise-security universe
    deb http://approx.liceum.lan:9999/ubuntu-security/ precise-security multiverse
    # deb-src http://security.ubuntu.com/ubuntu precise-security multiverse
     
    ## Uncomment the following two lines to add software from Canonical's
    ## 'partner' repository.
    ## This software is not part of Ubuntu, but is offered by Canonical and the
    ## respective vendors as a service to Ubuntu users.
    deb http://approx.liceum.lan:9999/archive/ precise partner
    # deb-src http://archive.canonical.com/ubuntu precise partner
     
    ## This software is not part of Ubuntu, but is offered by third-party
    ## developers who want to ship their latest software.
    deb http://approx.liceum.lan:9999/extras/ precise main
    deb http://approx.liceum.lan:9999/ubuntu/ precise-proposed restricted main multiverse universe
    # deb-src http://extras.ubuntu.com/ubuntu precise main

  • Осталось только выполнить

    apt-get update
    apt-get dist-upgrade

Обсуждение

Ваш комментарий:
   ___    ___    ___    __ __   __    ____
  / _ |  / _ \  / _ )  / // /  / /   / __/
 / __ | / , _/ / _  | / _  /  / /__ / _/  
/_/ |_|/_/|_| /____/ /_//_/  /____//___/