Préparation
Architecture système
-
Pré requis :
-
LAMP
-
apt-mirror et +/- 500 Go d'espace disque (varie en fonction des branches sélectionnées).
-
-
Un système virtualisé avec deux disques (le premier de 10Go environ pour le système, le deuxième de 500Go pour accueillir le miroir).
Disques | Capacité | Répertoires montés |
---|---|---|
sda1 | 10Go | / (système) |
sdb1 | 500Go | /depot (miroir) |
-
L'avantage de cet architecture permet de démonter les dépôts indépendamment du système.
mkdir /depot echo "/dev/sdb1 /depot ext4 errors=remount-ro 0 1" >> /etc/fstab mount -a
Paquets
-
Parce que les versions d'apt-mirror sont boguées sur Debain et Ubuntu, on installe depuis SourceForge :
echo "deb http://apt-mirror.sourceforge.net/ apt-mirror/" >> /etc/apt/sources.list apt-get update apt-get install apt-mirror apache2
Configuration
-
On crée et on édite le fichier de configuration :
vi /depot/apt-mirror.conf ############# config ################## # set base_path /depot # set mirror_path $base_path/mirror set skel_path $base_path/skel set var_path $base_path/var set cleanscript $var_path/clean.sh set defaultarch i386 # set postmirror_script $var_path/postmirror.sh set run_postmirror 0 set nthreads 20 set _tilde 0 # ############# end config ############## deb http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial main restricted universe multiverse main/debian-installer deb http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse deb http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial-security main restricted universe multiverse deb http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse deb-amd64 http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial main restricted universe multiverse main/debian-installer deb-amd64 http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse deb-amd64 http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial-security main restricted universe multiverse deb-amd64 http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse deb-src http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial main restricted universe multiverse deb-src http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial-security main restricted universe multiverse deb-src http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse deb-src http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse clean http://ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu
-
On lance la mise à jour :
apt-mirror /depot/apt-mirror.conf
-
Le résultat après 1 jour de téléchargement intensif :
Downloading 355 index files using 20 threads... Begin time: Tue Apr 22 09:58:13 2014 [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... End time: Tue Apr 22 09:58:17 2014 Processing tranlation indexes: [TTTTTTTT] Downloading 189 translation files using 20 threads... Begin time: Tue Apr 22 09:58:17 2014 [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... End time: Tue Apr 22 09:58:19 2014 Processing indexes: [SSSSPPPPPPPP] 133.6 GiB will be downloaded into archive. Downloading 136357 archive files using 20 threads... Begin time: Tue Apr 22 09:58:30 2014 [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... End time: Tue Apr 22 14:08:47 2014 0 bytes in 0 files and 0 directories can be freed. Run /depot/var/clean.sh for this purpose.
-
Rendre les paquets accessibles :
ln -s /depot/mirror/ftp.free.fr/mirrors/ftp.ubuntu.com/ubuntu/ /var/www/ubuntu