APT-Proxy: making it easier to update the Ubuntu system on the Intranet.

Source: Internet
Author: User
In practice, this is often the case where only some computers in a unit are directly connected to the Internet, and more than a dozen computers installed with Ubuntu systems are installed in the intranet. In this case, the daily updates or software installation of Ubuntu systems has become a "headache". Is there any good way to solve this problem? To solve this problem, you can find a computer with Ubuntu installed with two NICs (one connected to the Internet and the other connected to the Intranet ), then install the Apt-proxy server software on the host, that is

In practice, this is often the case where only some computers in a unit are directly connected to the Internet, and more than a dozen computers installed with Ubuntu systems are installed in the intranet. In this case, the daily updates or software installation of Ubuntu systems has become a "headache". Is there any good way to solve this problem?

To solve this problem, you can find a computer with Ubuntu installed with two NICs (one connected to the Internet and the other connected to the Intranet ), then install the Apt-proxy server software on the host (this article introduces the Ubuntu Desktop 9.10 .).

Master Dong suggested: Apt-proxy is a proxy server software installed for APT software packages. It can create a complete copy of the software library of the external Backup Server locally. Other machines on the Intranet can update or install software by accessing the Apt-proxy server. When the Software Package requested by the client does not exist on the Apt-proxy server, Apt-proxy automatically downloads the software package from the external image server to the local device for the client to download and install.

Part I: download and install Apt-proxy

By default, the Apt-proxy server software is not installed in Ubuntu, but the Ubuntu software source already contains the installation package of the software. In the menu "system> System Management", locate the "new software package management" option and open it. Click the "Search" button on the toolbar of the window, enter the keyword "apt-proxy" in the "Search" dialog box, and the search result appears in the list of installable software packages (1 ). After the "apt-proxy" software package is marked and installed, the "/var/cache/Apt-proxy" directory of the installation package that will generate the apt-proxy cache downloaded from the external image server will be generated ", this directory is empty at the beginning.

Part II: Configure Apt-proxy

The configuration file for Apt-proxy is "/etc/apt-proxy/apt-proxy-v2.conf", which can be edited using an editor such as VI or Gedit.

The configuration file format is relatively simple. The file content is divided into several segments (items), which are enclosed in "[]" and the content in brackets is the segment name. For example, the "[DEFAULT]" section indicates some DEFAULT options of Apt-proxy, which can be set as needed.

For example, set the IP address, port number (9999 by default) of the host running Apt-proxy, and path of the cached downloaded software package (/var/cache/apt-proxy by default. The configuration file uses a half-width semicolon as the comment symbol, and the line with the plus points above does not have any effect. Here we find the "[ubuntu]" section (because the client is installed with the Ubuntu system, if the client is installed with Debian, you need to find the "[debian]" section ), there is a "backends" ("backend" is an external backup image server). If only one external backup image server is entered, the server address is directly following the "backends, otherwise, enter the address of the external backup storage in the next line. The setting of the "[ubuntu]" section is similar:

After the configuration file is set, save and exit and restart the Apt-proxy to make it take effect. To check whether the Apt-proxy server is running normally, run the "netstat-tnl" command to check whether port "9999" is listening. If yes, the Apt-proxy server is working normally, you can accept the client connection request.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.