Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Use apt-p2p up a local Debian package cache     - Linux system boot process ARM platforms (Linux)

- Comparison of Nginx and Nginx + (Server)

- Java Performance Tuning the proxy mode (Programming)

- Android float ball and boot from the start (Programming)

- CentOS 6.4 Telecom ADSL dial-up network configuration (Linux)

- Teach you how to ensure password security under the Linux operating system (Linux)

- Oracle 10g after the failure to start the upgrade (Oracle instance terminated. Disconnection forced) (Database)

- Bash command substitution (Programming)

- Recover Ubuntu 14.04 wakes up from standby in case mouse keyboard appears dead (Linux)

- Linux System Getting Started Learning: compile and install ixgbe driver in Ubuntu or Debian (Linux)

- C ++ 11 feature: decltype keywords (Programming)

- Some of the bibliographic management tools to good use on linux (Linux)

- SQLite (Database)

- Linux operating process information (Linux)

- Use 3G wireless network card under Linux (Linux)

- Production environment Linux bonding method standby mode slave card switch (Server)

- Yii PHP Framework Getting Started tutorial (Linux)

- Using packet capture libpcap be reconciliation package in Ubuntu 14.04 64 bits (Linux)

- Python KNN algorithm of actual realization (Programming)

- Linux command Detailed chpasswd bulk edit user password (Linux)

 
         
  Use apt-p2p up a local Debian package cache
     
  Add Date : 2016-04-14      
         
         
         
  I have several home computer running Debian GNU / Linux testing machine, co-located within a small LAN. Because Debian testing is a rolling update, so I take them every few days all the updates again. But a Chinese family to speed quickly or can not say, each machine must download hundreds of megabytes of software packages from the upstream source server to spend a lot of time; and secondly, this operation also to the software source servers caused no small burden.

Then I think Debian has developed over a called apt-p2p software, it is designed to cache downloaded packages available to other similarly running peers apt-p2p as a software download from the source added. So if you can use this software to build a Debian package cache in the LAN it?

apt-p2p written in Python, installed after the default listening to TCP and UDP port 9977, may change its behavior by /etc/apt-p2p/apt-p2p.conf. TCP port for both native apt download the package, and UDP port sharing tools used to build a common DHT network p2p file. Only need /etc/apt/sources.list file software source url, such as http: //mirror.server/debian/ inserted before the domain name server localhost: 9977, it becomes http: // localhost: 9977 / mirror. server / debian /, to obtain specific work packages from the Internet to the apt-p2p will be responsible for:

When you receive a file from a local apt download request, apt-p2p will first check if the file already exists in the cache directory tree
If already exists, but also to check whether the latest (HEAD by issuing a request to the source server software to achieve)
If so, then simply returns the cached files
Otherwise, download files from the Internet supplying apt, cached at the same time and record the hash value
Download the file will first try to download from peer at, not at the server and then download the software source
Cached files and other peer hash value is available to use. This process can /var/log/apt-p2p.log depth observation by apt-p2p log files.
Here is what I installed the apt-p2p host mycastle of sources.list:

deb http: // localhost: 9977 / mirrors.ustc.edu.cn / debian / testing main
deb-src http: // localhost: 9977 / mirrors.ustc.edu.cn / debian / testing main
deb http: // localhost: 9977 / mirrors.ustc.edu.cn / debian-security / testing / updates main
deb-src http: // localhost: 9977 / mirrors.ustc.edu.cn / debian-security testing / updates main
deb http: // localhost: 9977 / mirrors.ustc.edu.cn / debian / testing-proposed-updates main
deb-src http: // localhost: 9977 / mirrors.ustc.edu.cn / debian / testing-proposed-updates main
deb http: // localhost: 9977 / mirrors.ustc.edu.cn / debian / unstable main
deb-src http: // localhost: 9977 / mirrors.ustc.edu.cn / debian / unstable main
However apt-p2p caching can only give this machine, and if you try to directly access another host port 9977 will get a 404 error. So also need to set up in the installation apt-p2p http host a reverse proxy, so apt-p2p opinion, all requests are from the unit.

I am using a reverse proxy Pound, after it is installed is disabled by default. It is configured to enable the server /etc/pound/pound.cfg later to / etc / default / pound, and then use the service to start the server.

I use the following configuration:

... (Keep default)
ListenHTTP
Address0.0.0.0
Port9978
## Allow PUT and DELETE also (by default only GET, POST and HEAD) ?:
xHTTP 0
Service
BackEnd
Address127.0.0.1
Port9977
End
End
End
Listening port in 9978, back-end server in the machine 9977 port.

As a result, it can also host other 9978 port of apt-p2p cache. My approach is going to use in other hosts will be moved to the cache /etc/apt/sources.list /etc/apt/sources.list.d/50_main.list, then follow the cache host software to establish the source list / etc / apt / sources.list.d / 10_apt-p2p-home.list, just put the url localhost: 9977 into .local: 9978 can, of course, best to keep the source server software the same. So apt priority by using the apt-p2p reverse proxy cache when the cache is unavailable can still be directly connected to the source server software get the package:

10_apt-p2p-home.list:

deb http: //mycastle.local: 9978 / mirrors.ustc.edu.cn / debian / testing main
deb-src http: //mycastle.local: 9978 / mirrors.ustc.edu.cn / debian / testing main
deb http: //mycastle.local: 9978 / mirrors.ustc.edu.cn / debian-security / testing / updates main
deb-src http: //mycastle.local: 9978 / mirrors.ustc.edu.cn / debian-security testing / updates main
deb http: //mycastle.local: 9978 / mirrors.ustc.edu.cn / debian / testing-proposed-updates main
deb-src http: //mycastle.local: 9978 / mirrors.ustc.edu.cn / debian / testing-proposed-updates main
deb http: //mycastle.local: 9978 / mirrors.ustc.edu.cn / debian / unstable main
deb-src http: //mycastle.local: 9978 / mirrors.ustc.edu.cn / debian / unstable main
50_main.list:

deb http://mirrors.ustc.edu.cn/debian/ testing main
deb-src http://mirrors.ustc.edu.cn/debian/ testing main
deb http://mirrors.ustc.edu.cn/debian-security/ testing / updates main
deb-src http://mirrors.ustc.edu.cn/debian-security testing / updates main
deb http://mirrors.ustc.edu.cn/debian/ testing-proposed-updates main
deb-src http://mirrors.ustc.edu.cn/debian/ testing-proposed-updates main
deb http://mirrors.ustc.edu.cn/debian/ unstable main
deb-src http://mirrors.ustc.edu.cn/debian/ unstable main
Such as the installation of the apt-transport-https, can be replaced 50_main.list the http https.

This host name plus ".local" domain name format is a mDNS / DNS-SD protocol provided in the broadcast domain host positioning methods and publishing services, the main achievement has Avahi and the Mac OS X Bonjour.

Thus, in the LAN, any computer are available via apt-p2p priority package, an update that can benefit the whole family; even update multiple hosts in a short time, and only need to obtain a software source; and large-scale the data flows in high bandwidth local area network, further reducing update time and improve efficiency.

Just this way is equivalent to the non-cached host configured with two repositories, and when the two duplicate information source software portion is not synchronized (such as a laptop computer outside the LAN update the list of packages directly connected to the source server software ), apt-get source can not be used, because the examination of source package apt more stringent.
     
         
         
         
  More:      
 
- React Native (Programming)
- Linux system Perl Lite netstat (Linux)
- MySQL time field based partitioning scheme summary (Database)
- How to Install Winusb in Ubuntu 14.04 (Linux)
- Ubuntu deployed under regular tasks with crontab (Linux)
- Error: Unable to establish connection with FTP SFTP server (Server)
- ORA-12545: Connection failed because the target host or object does not exist (Database)
- Linux prohibit non-WHEEL user su command Detail (Linux)
- Linux 6 install Oracle 11g (64bit) (Database)
- Teamviewer not start in Linux (Linux)
- CentOS 6.0 system security level (Linux)
- Shell script to crawl through AWR SQL Report Problems (Database)
- Java Set and List in the relationship and difference (Programming)
- SSH automatic disconnection problem solving (Linux)
- CentOS 6.5 can not connect to the network under VMware (Linux)
- C ++ 11 feature: decltype keywords (Programming)
- How to create a remote (Linux)
- MySQL TIMESTAMP and DATETIME (Database)
- CentOS 6.7 compile and install LAMP (Server)
- Java concurrent programming combat (using synchronized synchronization method) (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.