Инструменты пользователя

Инструменты сайта


software:linux_server:local_or_private_ubuntu_mirror

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Предыдущая версия справа и слеваПредыдущая версия
Следующая версия
Предыдущая версия
software:linux_server:local_or_private_ubuntu_mirror [2024/06/02 17:29] – [Запуск и Автоисполнение] vladpolskiysoftware:linux_server:local_or_private_ubuntu_mirror [2025/02/01 09:45] (текущий) – внешнее изменение 127.0.0.1
Строка 36: Строка 36:
  
 =====Установка зависимостей===== =====Установка зависимостей=====
 +Установим web server Apache2 и настроим брандмауэр по аналогии в [[software:linux_server:ubuntu_server_install_apache|этой статье.]]
 +\\  
 Обновим список пакетов  Обновим список пакетов 
 \\   \\  
Строка 45: Строка 47:
 \\   \\  
 и установим небходимое ПО  и установим небходимое ПО 
 +\\  
 +Если web server Apache2 уже установлен, то
 +<file>
 +sudo apt install debmirror gnupg xz-utils
 +</file>
 +\\  
 +Иначе
 \\   \\  
 <file> <file>
Строка 100: Строка 109:
 {{:software:linux_server:repo_ubuntu_8.1.png?|}} {{:software:linux_server:repo_ubuntu_8.1.png?|}}
 \\   \\  
-c=====Скрипт mirrorkernel.sh======+c 
 +=====Скрипт mirrorkernel.sh======
 Теперь создадим mirrorkernel.sh, открыв предпочитаемый вами редактор таким образом Теперь создадим mirrorkernel.sh, открыв предпочитаемый вами редактор таким образом
 <file> <file>
Строка 117: Строка 127:
 --arch=amd64 /home/alisa/repo/debmirror/amd64/ --arch=amd64 /home/alisa/repo/debmirror/amd64/
 </file> </file>
 +\\  
 +  * --host=archive.ubuntulinux.org - это адрес репозитория (без слеша на конце,здесь archive.ubuntulinux.org)
 +  * --root=ubuntu - это тот каталог, от которого начнётся зеркалирование пакетов. Короче - это каталог, который виден сразу после захода на адрес, указанный в --host
 +  * --method=ftp - ftp или http
 +  * --dist=hardy,hardy-security,hardy-updates,hardy-backports - название версии дистрибутива, который нас интересует. Если вы всё еще используете старую версию Ubuntu 7.10 (Gutsy Gibbon), то вам необходимо немного подправить этот скрипт, в частности, необходимо изменить значения параметра --dist с hardy на gutsy.
 +  * --section=main,restricted,multiverse,universe - название секции, которая нам нужна (если не одна - разделитель запятая без пробелов)
 +  * --arch=i386 - архитектура. Значение i386 говорит о том, что будут скачаны пакеты для компьютера с архитектурой x86. Этот параметр также может принимать значение amd64 для 64-битных AMD или Intel компьютеров.
 \\   \\  
 {{:software:linux_server:repo_ubuntu_10.png?|}} {{:software:linux_server:repo_ubuntu_10.png?|}}
Строка 128: Строка 145:
 sudo chmod +x mirrorkernel.sh sudo chmod +x mirrorkernel.sh
 </file> </file>
 +chmod (от англ. change mode) — команда для изменения прав доступа к файлам и каталогам, используемая в Unix-подобных операционных системах. 
 +
 \\   \\  
 {{:software:linux_server:repo_ubuntu_11.png?|}} {{:software:linux_server:repo_ubuntu_11.png?|}}
Строка 137: Строка 156:
 sudo screen /home/alisa/repo/scripts/mirrorkernel.sh sudo screen /home/alisa/repo/scripts/mirrorkernel.sh
 </file> </file>
 +\\  
 +screen это терминальный мультиплексор. Процесс, запущенный внутри сессии через screen, будет продолжаться даже тогда, когда вы отключитесь от самой первой сессии.
 +[[https://www.gnu.org/software/screen/manual/screen.html|См. подробнее...]]
 +\\  
 +После выполнения команды пойдет загрузка файлов в наше локальное зеркало:
 +\\  
 +{{:software:linux_server:repo_ubuntu_20.png?|}}
 +\\  
 +Cron – планировщик задач. Если подробнее, то это утилита, позволяющая выполнять скрипты на сервере в назначенное время с заранее определенной периодичностью.
 +\\  
 +<file>
 +sudo crontab -e
 +</file>
 +\\  
 +Select an editor.  To change later, run 'select-editor'.
 +  1. /bin/nano        <---- easiest
 +  2. /usr/bin/vim.basic
 +  3. /usr/bin/vim.tiny
 +  4. /bin/ed
 +
 +Choose 1-4 [1]: 1
 +------------------------
 +Для nano выберем 1
 +\\  
 +<file>
 +0 0 1 * * /home/alisa/repo/scripts/mirrorkernel.sh
 +</file>
 +\\  
 +запускать скрипт 1 числа каждого месяца
 +\\  
 +  * См. подробнее о [[https://timeweb.com/ru/community/articles/chto-takoe-cron|Cron и crontab]]
 +  * [[https://crontab.cronhub.io/|Генератор выражений Cron от Cronhub ]]
 +\\  
 +{{:software:linux_server:repo_ubuntu_21.png?|}}
 +\\  
 =====Настройка доступа к зеркалу===== =====Настройка доступа к зеркалу=====
 Создадим символическую ссылку из /home/alisa/repo/debmirror/amd64 на /var/www/ubuntu. Создадим символическую ссылку из /home/alisa/repo/debmirror/amd64 на /var/www/ubuntu.
Строка 162: Строка 216:
 {{:software:linux_server:repo_ubuntu_15.png?|}} {{:software:linux_server:repo_ubuntu_15.png?|}}
 \\   \\  
-перейдем на главную страницу в браузере нашего сервера (в примере http://192.168.1.44/)+перейдем на главную страницу в браузере нашего сервера (в примере http://192.168.1.152/)
 \\   \\  
 {{:software:linux_server:repo_ubuntu_16.png?|}} {{:software:linux_server:repo_ubuntu_16.png?|}}
 \\   \\  
-И наконец перейдем в папку для которой мы ранее указали символическую ссылку (в примере http://192.168.1.44/ubuntu/):+И наконец перейдем в папку для которой мы ранее указали символическую ссылку (в примере http://192.168.1.152/ubuntu/):
 \\   \\  
 +{{:software:linux_server:repo_ubuntu_18.png?|}}
 \\   \\  
 =====Файлы и Дополнения===== =====Файлы и Дополнения=====
-{{ :software:linux_server:debmirroramd64.sh.txt |debmirroramd64.sh.txt}}+Официальные репозитарии Ubuntu 
 +<file> 
 +deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse 
 +deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse 
 + 
 +deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse 
 +deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse 
 + 
 +deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse 
 +deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse 
 + 
 +deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse 
 +deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse 
 + 
 +deb http://archive.canonical.com/ubuntu/ jammy partner 
 +deb-src http://archive.canonical.com/ubuntu/ jammy partner 
 +</file> 
 + 
 +=====Настройка клиенских системы===== 
 +<fc #22b14c> Просмотреть все репозитории:</fc> 
 +<code> 
 +sudo nano /etc/apt/sources.list 
 +</code> 
 +<fc #22b14c>Они также могут находиться в одном из файлов в папке</fc> **/etc/apt/sources.list.d/** 
 +{{:software:nas:rsync_mirror_dsm_53.png?|}} 
 +<fc #22b14c>Сделаем архивную копию нашего оригинального файла sources.list</fc> 
 +<code> 
 +sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup 
 +</code> 
 +<details> 
 +<summary><fc #22b14c>См. запись оригинального файла sources.list</fc></summary> 
 +<code> 
 +#deb cdrom:[Ubuntu 22.04 LTS _Jammy Jellyfish_ - Release amd64 (20220419)]/ jammy main restricted 
 + 
 +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to 
 +# newer versions of the distribution. 
 +deb http://ru.archive.ubuntu.com/ubuntu/ jammy main restricted 
 +# deb-src http://ru.archive.ubuntu.com/ubuntu/ jammy main restricted 
 + 
 +## Major bug fix updates produced after the final release of the 
 +## distribution. 
 +deb http://ru.archive.ubuntu.com/ubuntu/ jammy-updates main restricted 
 +# deb-src http://ru.archive.ubuntu.com/ubuntu/ jammy-updates main restricted 
 + 
 +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
 +## team. Also, please note that software in universe WILL NOT receive any 
 +## review or updates from the Ubuntu security team. 
 +deb http://ru.archive.ubuntu.com/ubuntu/ jammy universe 
 +# deb-src http://ru.archive.ubuntu.com/ubuntu/ jammy universe 
 +deb http://ru.archive.ubuntu.com/ubuntu/ jammy-updates universe 
 +# deb-src http://ru.archive.ubuntu.com/ubuntu/ jammy-updates universe 
 + 
 +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
 +## team, and may not be under a free licence. Please satisfy yourself as to 
 +## your rights to use the software. Also, please note that software in 
 +## multiverse WILL NOT receive any review or updates from the Ubuntu 
 +## security team. 
 +deb http://ru.archive.ubuntu.com/ubuntu/ jammy multiverse 
 +deb http://ru.archive.ubuntu.com/ubuntu/ jammy multiverse 
 +# deb-src http://ru.archive.ubuntu.com/ubuntu/ jammy multiverse 
 +deb http://ru.archive.ubuntu.com/ubuntu/ jammy-updates multiverse 
 +# deb-src http://ru.archive.ubuntu.com/ubuntu/ jammy-updates multiverse 
 + 
 +## N.B. software from this repository may not have been tested as 
 +## extensively as that contained in the main release, although it includes 
 +## newer versions of some applications which may provide useful features. 
 +## Also, please note that software in backports WILL NOT receive any review 
 +## or updates from the Ubuntu security team. 
 +deb http://ru.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse 
 +# deb-src http://ru.archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse 
 + 
 +deb http://security.ubuntu.com/ubuntu jammy-security main restricted 
 +# deb-src http://security.ubuntu.com/ubuntu jammy-security main restricted 
 +deb http://security.ubuntu.com/ubuntu jammy-security universe 
 +# deb-src http://security.ubuntu.com/ubuntu jammy-security universe 
 +deb http://security.ubuntu.com/ubuntu jammy-security multiverse 
 +# deb-src http://security.ubuntu.com/ubuntu jammy-security multiverse 
 + 
 +# This system was installed using small removable media 
 +# (e.g. netinst, live or single CD). The matching "deb cdrom" 
 +# entries were disabled at the end of the installation process. 
 +# For information about how to configure apt package sources, 
 +# see the sources.list(5) manual. 
 +</code> 
 +</details> 
 + 
 +<fc #22b14c>Удалим подключенные репозитории, замени их на наше зеркало и сохраним файл:</fc> 
 +<code> 
 +deb http://192.168.1.20/ubuntu/ jammy main restricted 
 +deb http://192.168.1.20/ubuntu/ jammy-updates main restricted 
 +deb http://192.168.1.20/ubuntu/ jammy universe 
 +deb http://192.168.1.20/ubuntu/ jammy-updates universe 
 +</code> 
 +{{:software:nas:rsync_mirror_dsm_54.png?|}} 
 +<fc #22b14c>Получим обновленные списки пакетов:</fc> 
 +<code> 
 +sudo apt-get update 
 +</code> 
 +<fc #22b14c>обновить список пакетов.</fc> 
 +sudo apt update 
 +{{:software:nas:rsync_mirror_dsm_56.png?|}} 
 +<fc #22b14c>обновим пакеты</fc> 
 +<code> 
 +sudo apt-get dist-upgrade 
 +</code> 
 +{{:software:nas:rsync_mirror_dsm_57.png?|}} 
 + 
 +<fc #22b14c>Удалим подключенные репозитории на машине с Ubuntu 24.04, заменим их на наше зеркало и сохраним файл:</fc> 
 +<code> 
 +deb http://192.168.1.20/ubuntu/ noble main restricted 
 +deb http://192.168.1.20/ubuntu/ noble-updates main restricted 
 +deb http://192.168.1.20/ubuntu/ noble universe 
 +deb http://192.168.1.20/ubuntu/ noble-updates universe 
 +</code> 
 + 
 +<details> 
 +<summary><fc #22b14c>См. запись полного файла sources.list для Ubuntu 24.04 LTS noble Jellyfish </fc></summary> 
 +<code> 
 +#deb cdrom:[Ubuntu 24.04 LTS _noble Jellyfish_ - Release amd64 (20220419)]/ noble main restricted 
 + 
 +# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to 
 +# newer versions of the distribution. 
 +deb http://192.168.1.20/ubuntu/ noble main restricted 
 +# deb-src http://192.168.1.20/ubuntu/ noble main restricted 
 + 
 +## Major bug fix updates produced after the final release of the 
 +## distribution. 
 +deb http://192.168.1.20/ubuntu/ noble-updates main restricted 
 +# deb-src http://192.168.1.20/ubuntu/ noble-updates main restricted 
 + 
 +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
 +## team. Also, please note that software in universe WILL NOT receive any 
 +## review or updates from the Ubuntu security team. 
 +deb http://192.168.1.20/ubuntu/ noble universe 
 +# deb-src http://192.168.1.20/ubuntu/ noble universe 
 +deb http://192.168.1.20/ubuntu/ noble-updates universe 
 +# deb-src http://192.168.1.20/ubuntu/ noble-updates universe 
 + 
 +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
 +## team, and may not be under a free licence. Please satisfy yourself as to 
 +## your rights to use the software. Also, please note that software in 
 +## multiverse WILL NOT receive any review or updates from the Ubuntu 
 +## security team. 
 +deb http://192.168.1.20/ubuntu/ noble multiverse 
 +deb http://192.168.1.20/ubuntu/ noble multiverse 
 +# deb-src http://192.168.1.20/ubuntu/ noble multiverse 
 +deb http://192.168.1.20/ubuntu/ noble-updates multiverse 
 +# deb-src http://192.168.1.20/ubuntu/ noble-updates multiverse 
 + 
 +## N.B. software from this repository may not have been tested as 
 +## extensively as that contained in the main release, although it includes 
 +## newer versions of some applications which may provide useful features. 
 +## Also, please note that software in backports WILL NOT receive any review 
 +## or updates from the Ubuntu security team. 
 +deb http://192.168.1.20/ubuntu/ noble-backports main restricted universe multiverse 
 +# deb-src http://192.168.1.20/ubuntu/ noble-backports main restricted universe multiverse 
 + 
 +deb http://192.168.1.20/ubuntu noble-security main restricted 
 +# deb-src http://192.168.1.20/ubuntu noble-security main restricted 
 +deb http://192.168.1.20/ubuntu noble-security universe 
 +# deb-src http://192.168.1.20/ubuntu noble-security universe 
 +deb http://192.168.1.20/ubuntu noble-security multiverse 
 +# deb-src http://192.168.1.20/ubuntu noble-security multiverse 
 + 
 +# This system was installed using small removable media 
 +# (e.g. netinst, live or single CD). The matching "deb cdrom" 
 +# entries were disabled at the end of the installation process. 
 +# For information about how to configure apt package sources, 
 +# see the sources.list(5) manual. 
 +</code> 
 +</details> 
 + 
 +{{:software:nas:rsync_mirror_dsm_84.png?|}} 
 +<fc #22b14c>Получим обновленные списки пакетов:</fc> 
 +<code> 
 +sudo apt-get update 
 +</code> 
 +<fc #22b14c>обновить список пакетов.</fc> 
 +sudo apt update 
 +{{:software:nas:rsync_mirror_dsm_80.png?|}} 
 +<fc #22b14c>обновим пакеты</fc> 
 +<code> 
 +sudo apt-get dist-upgrade 
 +</code> 
 + 
 +{{:software:nas:rsync_mirror_dsm_83.png?|}} 
 +=====Дополнения и Файлы===== 
 + 
 +  * {{ :software:linux_server:debmirroramd64.sh.txt |debmirroramd64.sh.txt}}
software/linux_server/local_or_private_ubuntu_mirror.1717338574.txt.gz · Последнее изменение: vladpolskiy