Dies ist eine alte Version des Dokuments!
Repositiory synchronisieren
Auf Server
- FTP einrichten
- Repo herunterladen
reposync --gpgcheck -l --downloadcomps --repoid=base --norepopath --download_path=/var/ftp/centos/7/base/x86_64
- Inhaltsverzeichnis erstellen
createrepo -v -g /var/ftp/centos/7/base/x86_64/comps.xml /var/ftp/centos/7/base/
Auf Client
- ensprechendes Repo deaktivieren
yum-config-manager –disable <reponame>
(Reponame überyum repolist
) - oder Repo-Datei löschen
- Repo einbinden
yum-config-manager –add-repo=<Server>/<Reponame>
yum repolist all
- in der entsprechendnen Repo-Datei (/etc/yum.repos.d/<name>.repo) den Reponamen ändern:
Beispiel:[own_centos_7_base] name=Mirrored CentOS7 - base baseurl=ftp://192.168.0.55/centos/7/base enabled=1
Repo-Datei
Eine fertige .repo-Datei könnte wie folgt aussehen
- my_local.repo
[own_centos_7_base] name=Mirrored CentOS7 - base baseurl=ftp://192.168.0.55/centos/7/base enabled=1 [own_centos_7_updates] name=Mirrored CentOS7 - Updates baseurl=ftp://192.168.0.55/centos/7/updates enabled=1 [own_centos_7_epel] name=Mirrored CentOS7 - epel baseurl=ftp://192.168.0.55/centos/7/epel enabled=1 [own_centos_7_extras] name=Mirrored CentOS7 - extras baseurl=ftp://192.168.0.55/centos/7/extras enabled=1
Script zum syncen der Repos
- repo_sync.sh
#!/bin/bash reposync --gpgcheck -l --downloadcomps --repoid=base --norepopath --download_path=/var/ftp/centos/7/base/x86_64 \ && createrepo -g /var/ftp/centos/7/base/x86_64/comps.xml /var/ftp/centos/7/base/ reposync --gpgcheck -l --downloadcomps --repoid=extras --norepopath --download_path=/var/ftp/centos/7/extras/x86_64 \ && createrepo /var/ftp/centos/7/extras/ reposync --gpgcheck -l --downloadcomps --repoid=updates --norepopath --download_path=/var/ftp/centos/7/updates/x86_64 \ && createrepo /var/ftp/centos/7/updates/ reposync --gpgcheck -l --downloadcomps --repoid=epel --norepopath --download_path=/var/ftp/centos/7/epel/x86_64 \ && createrepo -g /var/ftp/centos/7/epel/x86_64/comps.xml /var/ftp/centos/7/epel/
Diskussion