Создание локального репозитория CentOS 6.5
Устанавливаем необходимое ПО:
Создаем папку для хранения пакетов:
Синхронизируем наш репозиторий с репозиторием от яндекса:
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 выполнять не требуется.
В большинстве статей для создания репозитория исопльзуется сервер Apache. Его относительно долго настраивать. Для старта http сервера python (который входит в число пакетов дистрибутива по умолчанию), достаточно перейти в нужный каталог и выполнить 1 команду:
$ cd /var/www/html/
$ python -m SimpleHTTPServer 80
Подключаемся к серверу по 80 порту и проверяем, все ли работает нормально.
Теперь наш репозиторий необходимо протестировать.
Удаляем старые файлы с описанием репозиториев # rm -rf /etc/yum.repos.d/* Создаем новый файл с описанием репозитория:
Вставляем в него:
[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
# 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.el6_5
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.el65.1
update
tzdata.noarch 2013i-1.el6
update
yum.noarch 3.2.29-43.el6.centos
update
# yum update
# 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://ronix.net.ua/2009/01/centos.html
http://hrafn.me/articles/package-management-in-rhel6-yum/