Often, when deploying a network of machines on Ubuntu, there is a problem with the organization of Internet access in order to install new programs from standard repositories. For example, when only a very narrow channel on the Internet is available or traffic is not unlimited. Fortunately, the principle of the organization of the Ubuntu package system allows you to very flexibly control what and from where to download using regular package management tools. In particular, you can create a local copy of the Ubuntu online repositories you need and connect it as the main source of applications to your local network. Thus, all computers on your network will not require an Internet connection to install new programs and updates. And at the same time, and most importantly, all the functionality of package managers will remain.
sudo apt-get install apt-mirror ############# apt-mirror ################## # , set base_path /media/data/ubuntu-repo # , . # - . #set mirror_path $base_path/mirror # apt-mirror #set skel_path $base_path/skel # apt-mirror #set var_path $base_path/var # , . - , apt-mirror. set defaultarch i386 # . . set nthreads 20 set _tilde 0 ############# ############## # Canonical Ubuntu 10.10 deb http://archive.ubuntu.com/ubuntu maverick main restricted deb http://archive.ubuntu.com/ubuntu maverick-updates main restricted deb http://archive.ubuntu.com/ubuntu maverick universe deb http://archive.ubuntu.com/ubuntu maverick-updates universe deb http://archive.ubuntu.com/ubuntu maverick multiverse deb http://archive.ubuntu.com/ubuntu maverick-updates multiverse deb http://archive.ubuntu.com/ubuntu maverick-security main restricted deb http://archive.ubuntu.com/ubuntu maverick-security universe deb http://archive.ubuntu.com/ubuntu maverick-security multiverse # apt-mirror, ubuntu # (, , ) , # . clean http://archive.ubuntu.com/ubuntu mkdir -p /media/data/ubuntu-repo/ mkdir -p /media/data/ubuntu-repo/{mirror,var,skel} sudo chown -R apt-mirror /media/data/ubuntu-repo/ sudo -u apt-mirror apt-mirror # sudo -u apt-mirror apt-mirror Downloading 55 index files using 20 threads... Begin time: Tue Dec 21 14:53:48 2010 [20]... [19]... [18]... [17]... [16]... [15]... End time: Tue Dec 21 14:54:06 2010 Proceed indexes: [PPPPPPPPPP] 36.2 GiB will be downloaded into archive. Downloading 33541 archive files using 20 threads... # # Regular cron jobs for the apt-mirror package # 0 4 * * * apt-mirror /usr/bin/apt-mirror > /var/spool/apt-mirror/var/cron.log # skip-clean http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-i386/ skip-clean http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/ # amd64 deb-amd64 http://archive.ubuntu.com/ubuntu maverick main restricted # deb http://user:pass@example.foo.org:8080/ubuntu maverick main restricted deb http://archive.ubuntu.com/ubuntu maverick main restricted sudo aptitude install apache2 sudo ln -s /media/data/ubuntu-repo/mirror/archive.ubuntu.com/ubuntu /var/www/ubuntu deb http://__/ubuntu maverick main restricted deb file:/media/data/ubuntu-repo/mirror/archive.ubuntu.com/ubuntu maverick main restricted Source: https://habr.com/ru/post/110444/
All Articles