Ссылки:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
https://wiki.debian.org/ru/CreateLocalRepo https://wiki.debian.org/DebianRepository/Setup https://wiki.debian.org/DebianRepository/Setup?action=show&redirect=HowToSetupADebianRepository https://low-level.wiki/mirrors/ubuntu_repos.html https://computingforgeeks.com/creating-ubuntu-mirrors-using-apt-mirror/ http://www.linux-admins.net/2013/11/creating-official-debian-mirror-with.html https://wiki.debian.org/DebianRepository/Setup https://habr.com/ru/post/46314/ https://linuxhint.com/export-import-keys-with-gpg/ https://wiki.ubuntu.com/Mirrors/Scripts https://askubuntu.com/questions/1105932/18-04-local-mirror-missing-some-translations-en http://freecoder.ru/zametki-o-linux/apt #### patch error: i18n/Translation-en 404 Not Found https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=932379 |
Репозитории debian 11:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Редактируем список репозиториев vim /etc/apt/sources.list ------------------------- deb http://deb.debian.org/debian bullseye main contrib non-free deb-src http://deb.debian.org/debian bullseye main contrib non-free deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free deb http://deb.debian.org/debian bullseye-updates main contrib non-free deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free deb http://deb.debian.org/debian bullseye-backports main contrib non-free deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free ------------------------- |
Установка apt-mirror:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
0. Ставим пакеты: apt update apt install apt-mirror vim nginx gnupg 1. Редактируем настройки apt-mirror vim /etc/apt/mirror.list ------------------------ ############# config ################## # set base_path /var/spool/apt-mirror # # 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 <running host architecture> # set postmirror_script $var_path/postmirror.sh set run_postmirror 0 set nthreads 20 set _tilde 0 # ############# end config ############## #deb http://ftp.us.debian.org/debian unstable main contrib non-free #deb-src http://ftp.us.debian.org/debian unstable main contrib non-free # mirror additional architectures #deb-alpha http://ftp.us.debian.org/debian unstable main contrib non-free #deb-amd64 http://ftp.us.debian.org/debian unstable main contrib non-free #deb-armel http://ftp.us.debian.org/debian unstable main contrib non-free #deb-hppa http://ftp.us.debian.org/debian unstable main contrib non-free #deb-i386 http://ftp.us.debian.org/debian unstable main contrib non-free #deb-ia64 http://ftp.us.debian.org/debian unstable main contrib non-free #deb-m68k http://ftp.us.debian.org/debian unstable main contrib non-free #deb-mips http://ftp.us.debian.org/debian unstable main contrib non-free #deb-mipsel http://ftp.us.debian.org/debian unstable main contrib non-free #deb-powerpc http://ftp.us.debian.org/debian unstable main contrib non-free #deb-s390 http://ftp.us.debian.org/debian unstable main contrib non-free #deb-sparc http://ftp.us.debian.org/debian unstable main contrib non-free ### need repo # deb http://deb.debian.org/debian bullseye main contrib non-free deb-src http://deb.debian.org/debian bullseye main contrib non-free deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free deb http://deb.debian.org/debian bullseye-updates main contrib non-free deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free deb http://deb.debian.org/debian bullseye-backports main contrib non-free deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free # #### need repo end #clean clean http://deb.debian.org/debian clean http://deb.debian.org/debian-security ------------------------ 2. Редактируем настройки nginx vim /etc/nginx/conf.d/mirrors.conf ---------------------------------- server { listen 80; server_name mirror.b14esh.com; root /var/spool/apt-mirror; location / { autoindex on; } } ---------------------------------- 3. еще можно заменить дефолтный nginx vim /etc/nginx/sites-available/default -------------------------------------- root /var/spool/apt-mirror; -------------------------------------- 4. После настройки nginx systemctl restart nginx.service !!! Придется делать каждый раз после обновления репозитория, но проще добавить "[trusted=yes]" 5. Подпись репозитория - Переходим в каталог root: cd /root - Создаем ключ: #gpg --full-gen-key gpg --gen-key - Переходим в каталог репозитория: cd /var/spool/apt-mirror - Ищем "Release.gpg": find -name Release.gpg ./mirror/deb.debian.org/debian-security/dists/bullseye-security/Release.gpg ./mirror/deb.debian.org/debian/dists/bullseye-backports/Release.gpg ./mirror/deb.debian.org/debian/dists/bullseye-updates/Release.gpg ./mirror/deb.debian.org/debian/dists/bullseye/Release.gpg ./skel/deb.debian.org/debian-security/dists/bullseye-security/Release.gpg ./skel/deb.debian.org/debian/dists/bullseye-backports/Release.gpg ./skel/deb.debian.org/debian/dists/bullseye-updates/Release.gpg ./skel/deb.debian.org/debian/dists/bullseye/Release.gpg - Подписываем репозиторий: cd /var/spool/apt-mirror/mirror/deb.debian.org/debian-security/dists/bullseye-security/ gpg --armor -o Release.gpg -sb Release cd /var/spool/apt-mirror/mirror/deb.debian.org/debian/dists/bullseye-backports/ gpg --armor -o Release.gpg -sb Release cd /var/spool/apt-mirror/mirror/deb.debian.org/debian/dists/bullseye-updates/ gpg --armor -o Release.gpg -sb Release cd /var/spool/apt-mirror/mirror/deb.debian.org/debian/dists/bullseye/ gpg --armor -o Release.gpg -sb Release cd /var/spool/apt-mirror/skel/deb.debian.org/debian-security/dists/bullseye-security/ gpg --armor -o Release.gpg -sb Release cd /var/spool/apt-mirror/skel/deb.debian.org/debian/dists/bullseye-backports/ gpg --armor -o Release.gpg -sb Release cd /var/spool/apt-mirror/skel/deb.debian.org/debian/dists/bullseye-updates/ gpg --armor -o Release.gpg -sb Release cd /var/spool/apt-mirror/skel/deb.debian.org/debian/dists/bullseye/ gpg --armor -o Release.gpg -sb Release - Экспортируем ключ: gpg --list-keys - смотрим какие есть ключи gpg --export -a USER_NAME > /var/spool/apt-mirror/public.gpg |
Использование репозитория:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#wget http://192.168.15.157/public.gpg wget http://sever_name_IP/pubring.gpg apt-key add public.gpg Для использования репозитория нужно добавить его в файл /etc/apt/sources.list в виде следующей строки (в общем виде): deb file:///путь_к_папке_репозитория/ ветка разделы Например: deb file:///home/repository/ squeeze main contrib non-free Пример: deb [trusted=yes] http://192.168.15.157/deb.debian.org/debian bullseye main contrib non-free deb-src [trusted=yes] http://192.168.15.157/deb.debian.org/debian bullseye main contrib non-free deb [trusted=yes] http://192.168.15.157/deb.debian.org/debian-security/ bullseye-security main contrib non-free deb-src [trusted=yes] http://192.168.15.157/deb.debian.org/debian-security/ bullseye-security main contrib non-free deb [trusted=yes] http://192.168.15.157/deb.debian.org/debian bullseye-updates main contrib non-free deb-src [trusted=yes] http://192.168.15.157/deb.debian.org/debian bullseye-updates main contrib non-free deb [trusted=yes] http://192.168.15.157/deb.debian.org/debian bullseye-backports main contrib non-free deb-src [trusted=yes] http://192.168.15.157/deb.debian.org/debian bullseye-backports main contrib non-free |