wiki:centos:repo_sync

Repositiory synchronisieren

Auf Server

  1. FTP einrichten
  2. Repo herunterladen
    reposync --gpgcheck -l --downloadcomps --repoid=base --norepopath --download_path=/var/ftp/centos/7/base/x86_64
  3. Inhaltsverzeichnis erstellen
    createrepo -v -g /var/ftp/centos/7/base/x86_64/comps.xml /var/ftp/centos/7/base/

Auf Client

  1. ensprechendes Repo deaktivieren yum-config-manager –disable <reponame> (Reponame über yum repolist)
  2. oder Repo-Datei löschen
  3. Repo einbinden yum-config-manager –add-repo=<Server>/<Reponame>
  4. yum repolist all
  5. 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

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
repo_sync.sh
#!/bin/bash
 
####################################################################
#
# Script, um die CentOS 7 Repos herunterzuladen und ein eigenständiges
# Repo aufzubauen
#
#
####################################################################
 
repo_path="/var/ftp/centos/7/"
 
function textbox () {
cat << EOF
 
******************************
* $1
******************************
 
EOF
}
 
textbox base-Repo
reposync --gpgcheck -l --downloadcomps --repoid=base --norepopath --download_path=$repo_path/base/x86_64 \
        && createrepo -g $repo_path/base/x86_64/comps.xml $repo_path/base/
 
textbox extras-Repo
reposync --gpgcheck -l --downloadcomps --repoid=extras --norepopath --download_path=$repo_path/extras/x86_64 \
        && createrepo $repo_path/extras/
 
textbox updates-Repo
reposync --gpgcheck -l --downloadcomps --repoid=updates --norepopath --download_path=$repo_path/updates/x86_64 \
        && createrepo $repo_path/updates/
 
textbox epel-Repo
reposync --delete --gpgcheck -l --downloadcomps --repoid=epel --norepopath --download_path=$repo_path/epel/x86_64 \
        && createrepo -g $repo_path/epel/x86_64/comps.xml $repo_path/epel/

Quellen

Geben Sie Ihren Kommentar ein. Wiki-Syntax ist zugelassen:
  __  __  _      __   ____   ___    ___ 
 / / / / | | /| / /  / __/  / _ |  / _ \
/ /_/ /  | |/ |/ /  / _/   / __ | / ___/
\____/   |__/|__/  /___/  /_/ |_|/_/
 
  • wiki/centos/repo_sync.txt
  • Zuletzt geändert: 2015/05/26 10:31
  • von wikiadmin