Skip to main content

Installer un miroir Debian

Procédure pour installer un miroir Debian. 

apt-get update && apt-get upgrade -y
apt-get install apt-mirror apache2 -y

 

mkdir -p /depot/{mirror,skel,var}
chown -R apt-mirror:apt-mirror /depot
chmod -R 755 /depot

nano /etc/apt/mirror.list

############# 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 /depot/var/clean.sh
set run_postmirror 0


set nthreads 20
set _tilde 0

############# end config ##############

# Debian Buster
deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free
deb http://deb.debian.org/debian-security/ buster/updates main
deb-src http://deb.debian.org/debian-security/ buster/updates main
deb http://deb.debian.org/debian buster-updates main contrib non-free

# Debian Stretch
deb http://deb.debian.org/debian/ stretch main contrib non-free
deb-src http://deb.debian.org/debian/ stretch main contrib non-free
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free
deb http://deb.debian.org/debian/ stretch-updates main contrib non-free
deb-src http://deb.debian.org/debian/ stretch-updates main contrib non-free

# Suppression des paquets obsoletes
clean http://security.debian.org/
apt-mirror /etc/apt/mirror.list
ln -s /depot/mirror/deb.debian.org/debian-security /var/www/html/debian-security
ln -s /depot/mirror/deb.debian.org/debian /var/www/html/debian

nano /etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
    DocumentRoot /var/www/html/
    ErrorLog ${APACHE_LOG_DIR}/public.log
    CustomLog ${APACHE_LOG_DIR}/public.log combined
    LogLevel warn
</VirtualHost>

 

crontab -e 

0 5 * * * root /usr/bin/apt-mirror /etc/apt/mirror.list > /depot/mirror/var/cron.log

 

Configuration des machines clientes :

nano /etc/apt/sources.list

deb http://miroir-debian/debian/ buster main
deb-src http://ftp.fr.debian.org/debian buster main
deb http://miroir-debian/debian-security buster/updates main
deb-src http://ftp.fr.debian.org/debian-security buster/updates main
deb http://miroir-debian/debian buster-updates main
deb-src http://ftp.fr.debian.org/debian buster-updates main

mirdeb correspond au nom du serveur miroir debian.

 

Correction des erreurs de traduction :

nano /usr/bin/apt-mirror

 

On ajoute ces lignes à la ligne 355 à l'intérieur du foreach. 

Pour allez simplement à la ligne 355 : Ctrl+W suivi de Ctrl+T et 355.

my $lang;
foreach $lang ("ast", "bg", "bs", "ca", "cs", "da", "de", "el", "en", "en_AU", "en_CA", "en_GB", "eo", "es", "eu", "fa", "fi", "fr", "fr_FR", "gl", "hr", "hu", "id", "is", "it", "ja", "ka", "km", "ko", "lt", "ms", "my", "nb", "nl", "no_NB", "oc", "pl", "pt", "pt_BR", "ro", "ru", "si", "sk", "sl", "sq", "sr", "sv", "th", "tr", "uk", "vi", "zh_CN", "zh_HK", "zh_TW", "zh") {
      add_url_to_download($url . $_ . "/i18n/Translation-" . $lang);
      add_url_to_download($url . $_ . "/i18n/Translation-" . $lang . ".gz");
      add_url_to_download($url . $_ . "/i18n/Translation-" . $lang . ".bz2");
}

 

 

image-1608037795529.png