Ubuntu8.10 configure apt-get proxy server for Dummies

Source: Internet
Author: User
Article Title: ubuntu8.10 configure apt-get proxy server for Dummies. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems and open-source, and other basic categories to install and uninstall apt-proxy servers

Select a host in the network as the apt-proxy server, and ensure sufficient storage space and smooth Internet connection. Installation and uninstallation of the apt-proxy Server are simple.
1. Install apt-proxy

You can still use "apt-get install" to obtain and install the apt-proxy service package. The following command gets the installation process of apt-proxy. At the end of the installation, the Ubuntu Liunx system immediately starts the apt-proxy service.

Sudo apt-get install apt-proxy

Reading the package list... complete

Analyzing the dependency tree of the software package

Read status information... complete

The following additional software packages will be installed:

Python-twisted-bin python-twisted-core python-twisted-web python-zopeinterface

Recommended software packages:

Python-twisted-bin-dbg python-tk python-qt3 python-profiler python-
Zopeinterface-dbg

Recommended software packages:

Python-pyopenssl python-pam python-serial

The following [new] software packages will be installed:

Apt-proxy python-twisted-bin python-twisted-core python-twisted-web python-zopeinterface

A total of 0 software packages have been upgraded, 5 new software packages have been installed, 0 software packages have to be uninstalled, 26 software have not been upgraded.

Download a kb package.

After decompression, the extra space of 7049kB is consumed.

Do you want to continue? [Y/n] Y

Obtain: 1 Http://us.archive.ubuntu.com Feisty/main python-twisted-bin 2.5.0-0ubuntu3 [21.0kB]

Get: 2 Http://us.archive.ubuntu.com Feisty/main python-zopeinterface 3.3.1-0ubuntu3 [134kB]

Get: 3 Http://us.archive.ubuntu.com Feisty/main python-twisted-core 2.5.0-0ubuntu3 [753kB]

34% [3 python-twisted-core 292420/753 kB 38%]

...

Configuring the software package...

The apt-proxy software package that has been canceled is selected.

(Reading the database... the system currently has a total of 114121 files and directories installed .)

Extracting apt-proxy (from.../apt-proxy_1.9.35ubuntu2_all.deb )...

Setting apt-proxy (1.9.35ubuntu2 )...

* Starting apt-proxy

By default, the apt-proxy Server opens a cache zone --/var/cache/apt-proxy, which stores the software packages downloaded from the Ubuntu image site in this directory; the default apt-proxy listening port number is 9999. You can run the following command to check whether the apt-proxy service port is in the listening status.

Netstat? L | grep-I 9999

Tcp 0 0 *: 9999 *: * LISTEN
2. Uninstall apt-proxy

Use "apt-get remove" to uninstall the apt-proxy service software. You can choose to detach the software completely or retain the relevant configuration information. Run the following command to completely delete apt-proxy, and immediately stop the proxy service opened by the current system after uninstalling.

Sudo apt-get purge apt-proxy

Reading the package list... complete

Analyzing the dependency tree of the software package

Read status information... complete

The following software packages will be [uninstalled ]:

Apt-proxy *

A total of 0 software packages were upgraded, and 0 software packages were newly installed. One software package was to be uninstalled, and 26 software were not upgraded.

You need to download the 0B software package.

After decompression, the space of 422kB is empty.

Do you want to continue? [Y/n] y

(Reading the database... the system currently has a total of 114163 files and directories installed .)

Deleting apt-proxy...

* Stopping apt-proxy [OK]

Clearing the apt-proxy configuration file...
Configure the apt-proxy Server

Configuration highlights
1
; Is the meaning of the comment
2
Backends = the backend cannot recognize the carriage return, that is, \ n is not allowed.
For example
[Ubuntu]
; Ubuntu archive
Backends = Http://tw.archive.ubuntu.com/ubuntu Http://archive.ubuntu.com/ubuntu
# It's all about space-based online formatting.
3 client
#/Etc/apt/sources. list the IP address must be followed by the backend segment name (that is, all the items in the brackets of the apt-proxy-v2.conf)
# For example, I configured [ubuntu] In/etc-v2.confxy/apt-proxy-v2.conf
[Ubuntu]
; Ubuntu archive
Backends = Http://tw.archive.ubuntu.com/ubuntu Http://archive.ubuntu.com/ubuntu

# I will write it on/etc/apt/sources. list
Deb Http: // 127.0.0.1: 9999/ubuntu # Intrepid main restricted universe multiverse
# The bold two must be the same

# Intrepid main restricted universe multiverse
# The following section indicates Http://tw.archive.ubuntu.com/ubuntu To update the main restricted universe multiverse.

# ------------- The following is my configuration -----------------------
[DEFAULT]
; All times are in seconds, but you can add a suffix
; For minutes (m), hours (h) or days (d)

; Server IP to listen on
; Address = 192.168.0.254

; Server port to listen on
Port = 9999

; Control files (Packages/Sources/Contents) refresh rate
;;
; Minimum age of a file before it is refreshed
Min_refresh_delay = 1 h

; Minimum age of a file before attempting an update (not yet implemented)
; Min_age = 23 h

; Uncomment to make apt-proxy continue downloading even if all
; Clients disconnect. This is probably not a good idea on
; Dial up line.
; Complete_clientless_downloads = 1

; Debugging settings.
; For all debug information use this:
; Debug = all: 9
Debug = all: 4 db: 0

; Debugging remote python console
; Do not enable in an untrusted environment
; Telnet _port = 9998
; Telnet_user = apt-proxy
; Telnet_password = secret

; Network timeout when retrieving from backend servers
Timeout = 15

; Cache directory for apt-proxy
Cache_dir =/var/cache/apt-proxy

; Use passive FTP? (Default = on)
; Passive_ftp = on

; Use HTTP proxy?
; Http_proxy = [username: password @] host: port

; Limit download rate from backend servers (http and rsync only), in bytes/sec
; Bandwidth_limit = 100000

;;--------------------------------------------------------------
; Cache housekeeping

; Time to perform periodic housekeeping:
;-Delete files that have not been accessed in max_age
;-Scan cache directories and update internal tables
Cleanup_freq = 1d

; Maximum age of files before deletion from the cache (seconds)
Max_age = 120d

; Maximum number of versions of a. deb to keep per distribution
Max_versions = 3

; Add HTTP backends dynamicaly if not already defined? (Default = on)
; Dynamic_backends = on

;;---------------------------------------------------------------
;;---------------------------------------------------------------
; Backend servers
;;
; Place each server in its own [section]

[Debian]
; The main Debian archive
; You can override the default timeout like this:
; Timeout = 30

; Backend servers, in order of preference
Backends =
Http://tw.archive.ubuntu.com/ubuntu
Min_refresh_delay = 1d

[Security]
; Debian security archive
Backends = Http://tw.archive.ubuntu.com/ubuntu
Min_refresh_delay = 1 m
[Ubuntu]
; Ubuntu archive
Backends = Http://tw.archive.ubuntu.com/ubuntu Http://archive.ubuntu.com/ubuntu

[Ubuntu-security]
; Ubuntu security updates
Backends = Http://security.ubuntu.com/ubuntu

[Marillat]
; Backends = Ftp://ftp.nerim.net/debian-marillat

[Debian]
; Backend servers, in order of preference
; Backends =
Http://ftp.us.debian.org/debian
Http://ftp.de.debian.org/debian
Http://ftp2.de.debian.org/debian
Ftp://ftp.uk.debian.org/debian

[Debian-non-US]
; Debian debian-non-US archive
; Backends =
Http://ftp.uk.debian.org/debian-non-US
Http://ftp.de.debian.org/debian-non-US
Ftp://ftp.uk.debian.org/debian

[Security]
; Debian security archive
; Backends =
Http://security.debian.org/debian-security
Http://ftp2.de.debian.org/debian-security

[Openoffice]
; OpenOffice.org packages
; Backends = Http://ftp.freenet.de/pub/debian-openoffice Http://ftp.sh.cvut.cz/MIRRORS/OpenOffice.deb Http://borft.student.utwente.nl/debian

[Apt-proxy]
; Apt-proxy new versions
; Backends = Http://apt-proxy.sourceforge.net/apt-proxy
Related Article

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.