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

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


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

**Это старая версия документа!**

оздание локального репозитория CentOS 6.5

Устанавливаем необходимое ПО:

yum install -y wget \

rsync \ createrepo

Создаем папку для хранения пакетов:

mkdir -pv /var/www/html/centos/6.5/{os,updates}/x86_64

Синхронизируем наш репозиторий с репозиторием от яндекса:

rsync -iavrt rsync:mirror.yandex.ru/centos/6.5/os/x8664/ /var/www/html/centos/6.5/os/x8664/ rsync -iavrt rsync:mirror.yandex.ru/centos/6.5/updates/x8664/ /var/www/html/centos/6.5/updates/x8664/

Поскольку по rsync копируются не только rpm-ки, но и заголовки репозитория, то запуск createrepo выполнять не требуется.

cd /var/www/html/centos

wget http://mirror.yandex.ru/centos/RPM-GPG-KEY-CentOS-6

В большинстве статей для создания репозитория исопльзуется сервер Apache. Его относительно долго настраивать. Для старта http сервера python (который входит в число пакетов дистрибутива по умолчанию), достаточно перейти в нужный каталог и выполнить 1 команду:

$ cd /var/www/html/ $ python -m SimpleHTTPServer 80

Подключаемся к серверу по 80 порту и проверяем, все ли работает нормально.

Теперь наш репозиторий необходимо протестировать.

Удаляем старые файлы с описанием репозиториев # rm -rf /etc/yum.repos.d/* Создаем новый файл с описанием репозитория:

vi /etc/yum.repos.d/my-local-centos.repo

Вставляем в него:

[base] name=CentOS-$releasever - $basearch - Base enabled=1 baseurl=http://repo.domain/centos/6.5/os/$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 машины, которую планируется обновлять из этого репозитория.

Запускаем yum list для проверки. # yum list # yum repolist Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile repo id repo name status base CentOS-6 - x8664 - Base 6,367 update CentOS-6 - x8664 - Updates 287 repolist: 6,654 # yum clean all Loaded plugins: fastestmirror Cleaning repos: base update Cleaning up Everything Cleaning up list of fastest mirrors # yum check-update Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile ca-certificates.noarch 2013.1.95-65.1.el65 update ethtool.x8664 2:3.5-1.2.el65 update nss.x8664 3.15.3-3.el65 update nss-sysinit.x8664 3.15.3-3.el65 update nss-tools.x8664 3.15.3-3.el65 update openssl.x8664 1.0.1e-16.el6_5.1 update tzdata.noarch 2013i-1.el6 update yum.noarch 3.2.29-43.el6.centos update # yum update # yum info openssl.x8664 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Installed Packages Name : openssl Arch : x8664 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://ronix.net.ua/2009/01/centos.html http://hrafn.me/articles/package-management-in-rhel6-yum/

локальный_репозиторий.1410797366.txt.gz · Последнее изменение: 2014/09/15 20:09 (внешнее изменение)

DokuWiki Appliance - Powered by TurnKey Linux