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

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


локальный_репозиторий

Различия

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

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

Следующая версия
Предыдущая версия
локальный_репозиторий [2014/09/15 16:09]
kirill создано
локальный_репозиторий [2014/09/15 20:22] (текущий)
Строка 1: Строка 1:
-оздание локального репозитория CentOS 6.5+Создание локального репозитория CentOS 6.5
  
  
Строка 5: Строка 5:
 Устанавливаем необходимое ПО: Устанавливаем необходимое ПО:
  
-# yum install -y wget +# yum install -y wget rsync createrepo 
-rsync \ +
-createrepo+
  
 Создаем папку для хранения пакетов: Создаем папку для хранения пакетов:
 # mkdir -pv /var/www/html/centos/6.5/{os,updates}/x86_64 # mkdir -pv /var/www/html/centos/6.5/{os,updates}/x86_64
 +
 +
  
 Синхронизируем наш репозиторий с репозиторием от яндекса: Синхронизируем наш репозиторий с репозиторием от яндекса:
  
-rsync -iavrt rsync://mirror.yandex.ru/centos/6.5/os/x86_64/ /var/www/html/centos/6.5/os/x86_64/ +'' 
-rsync -iavrt rsync://mirror.yandex.ru/centos/6.5/updates/x86_64/ /var/www/html/centos/6.5/updates/x86_64/+rsync -iavrt rsync://mirror.yandex.ru/centos/6.5/os/x86_64/ /var/www/html/centos/6.5/os/x86_64/\\ 
 +rsync -iavrt rsync://mirror.yandex.ru/centos/6.5/updates/x86_64/ /var/www/html/centos/6.5/updates/x86_64/''
  
  
 Поскольку по rsync копируются не только rpm-ки, но и заголовки репозитория, то запуск createrepo выполнять не требуется. Поскольку по rsync копируются не только rpm-ки, но и заголовки репозитория, то запуск createrepo выполнять не требуется.
 +
  
  
 # cd /var/www/html/centos # cd /var/www/html/centos
 +
 # wget http://mirror.yandex.ru/centos/RPM-GPG-KEY-CentOS-6 # wget http://mirror.yandex.ru/centos/RPM-GPG-KEY-CentOS-6
 +
  
  
Строка 30: Строка 35:
  
 $ cd /var/www/html/ $ cd /var/www/html/
 +
 $ python -m SimpleHTTPServer 80 $ python -m SimpleHTTPServer 80
 +
  
 Подключаемся к серверу по 80 порту и проверяем, все ли работает нормально. Подключаемся к серверу по 80 порту и проверяем, все ли работает нормально.
 +
  
  
Строка 38: Строка 46:
  
 // Удаляем старые файлы с описанием репозиториев // Удаляем старые файлы с описанием репозиториев
 +
 # rm -rf /etc/yum.repos.d/* # rm -rf /etc/yum.repos.d/*
  
 // Создаем новый файл с описанием репозитория: // Создаем новый файл с описанием репозитория:
 +
 # vi /etc/yum.repos.d/my-local-centos.repo # vi /etc/yum.repos.d/my-local-centos.repo
  
 Вставляем в него: Вставляем в него:
 +''
 +[base]\\
  
-[base] +name=CentOS-$releasever - $basearch - Base\\ 
-name=CentOS-$releasever - $basearch - Base +enabled=1\\ 
-enabled=1 +baseurl=http://repo.domain/centos/6.5/os/$basearch/\\ 
-baseurl=http://repo.domain/centos/6.5/os/$basearch/ +gpgcheck=1\\ 
-gpgcheck=1 +gpgkey=http://repo.domain/centos/RPM-GPG-KEY-CentOS-6\\
-gpgkey=http://repo.domain/centos/RPM-GPG-KEY-CentOS-6 +
- +
-[update] +
-name=CentOS-$releasever - $basearch - Updates +
-enabled=1 +
-baseurl=http://repo.domain/centos/6.5/updates/$basearch/ +
-gpgcheck=1 +
-gpgkey=http://repo.domain/centos/RPM-GPG-KEY-CentOS-6+
  
 +[update]\\
 +name=CentOS-$releasever - $basearch - Updates\\
 +enabled=1\\
 +baseurl=http://repo.domain/centos/6.5/updates/$basearch/\\
 +gpgcheck=1\\
 +gpgkey=http://repo.domain/centos/RPM-GPG-KEY-CentOS-6\\
 +''
  
 repo.domain - разумеется должен быть резолвиться в DNS или быть прописан в hosts машины, которую планируется обновлять из этого репозитория. repo.domain - разумеется должен быть резолвиться в DNS или быть прописан в hosts машины, которую планируется обновлять из этого репозитория.
Строка 64: Строка 75:
  
 // Запускаем yum list для проверки. // Запускаем yum list для проверки.
-# yum list 
  
 +''# yum list\\
  
-# yum repolist 
-Loaded plugins: fastestmirror 
-Loading mirror speeds from cached hostfile 
-repo id                                      repo name                                                        status 
-base                                         CentOS-6 - x86_64 - Base                                         6,367 
-update                                       CentOS-6 - x86_64 - Updates                                        287 
-repolist: 6,654 
  
 +# yum repolist\\
  
  
-# yum clean all 
-Loaded plugins: fastestmirror 
-Cleaning repos: base update 
-Cleaning up Everything 
-Cleaning up list of fastest mirrors 
  
 +# yum clean all \\
  
-# yum check-update 
-Loaded plugins: fastestmirror 
-Loading mirror speeds from cached hostfile 
  
-ca-certificates.noarch                                  2013.1.95-65.1.el6_5                                  update 
-ethtool.x86_64                                          2:3.5-1.2.el6_5                                       update 
-nss.x86_64                                              3.15.3-3.el6_5                                        update 
-nss-sysinit.x86_64                                      3.15.3-3.el6_5                                        update 
-nss-tools.x86_64                                        3.15.3-3.el6_5                                        update 
-openssl.x86_64                                          1.0.1e-16.el6_5.1                                     update 
-tzdata.noarch                                           2013i-1.el6                                           update 
-yum.noarch                                              3.2.29-43.el6.centos                                  update 
  
 +# yum check-update\\
  
-# yum update+ 
 + 
 + 
 +# yum update\\
  
  
 # yum info openssl.x86_64 # yum info openssl.x86_64
-Loaded plugins: fastestmirror +'' 
-Loading mirror speeds from cached hostfile +
-Installed Packages +
-Name        : openssl +
-Arch        : x86_64 +
-Version     : 1.0.1e +
-Release     : 16.el6_5.1 +
-Size        : 4.0 M +
-Repo        : installed +
-From repo   : update +
-Summary     : A general purpose cryptography library with TLS implementation +
-URL         : http://www.openssl.org/ +
-License     : OpenSSL +
-Description : The OpenSSL toolkit provides support for secure communications between +
-            : machines. OpenSSL includes a certificate management tool and shared +
-            : libraries which provide various cryptographic algorithms and +
-            : protocols.+
  
  
  
 Почитать: Почитать:
 +
 +
 http://goodhack.net.ua/archives/320 http://goodhack.net.ua/archives/320
 +
 +
 http://ronix.net.ua/2009/01/centos.html http://ronix.net.ua/2009/01/centos.html
 +
 +
 http://hrafn.me/articles/package-management-in-rhel6-yum/ http://hrafn.me/articles/package-management-in-rhel6-yum/
  
  
локальный_репозиторий.1410797366.txt.gz · Последнее изменение: 2014/09/15 20:09 (внешнее изменение)

DokuWiki Appliance - Powered by TurnKey Linux