NSAS Wiki

Network System Access Solutions

User Tools

Site Tools


Sidebar

Contact

linux:redhat

redhat

Mirror script auf rhel-update

/root/scripts/mirror.sh
#!/bin/bash
#===============================================================================
#
#          FILE:  mirror.sh
#
#         USAGE:  ./mirror.sh
#
#   DESCRIPTION: This script will mirror the yum Redhat Enterprice repos
#                and generats a local repository.
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#       COMPANY: Lekker Energie GmbH
#       CREATED: 06/28/2012 12:08:43 PM CEST
#      REVISION:  ---
#     COPYRIGHT: Copyright (c) 2012, Michèl Pelzer 
#
#===============================================================================
#set -x         # Display commands and their arguments as they are executed.
#set -v         # Display shell input lines as they are read.
#set -n         # Read commands but do not execute them. This may be used to check a shell script for syntax errors.
set -o nounset  # Treat unset variables as an error
 
echo Updating Lekker RHEL Mirror
MIRRORPATH="/export/updates/rhel6/x86_64"
 
#Mirror Redhat
echo -en "-> Updating Redhat Packages\t\t"
reposync -n -q -p /export/updates --repoid=rhel-x86_64-server-6 -l >/dev/null 2>&1 && echo done || echo failed
 
#Mirror VMware
echo -en "-> Updating VMware Packages\t\t"
cd /tmp
wget -l 1 -r http://packages.vmware.com/tools/esx/4.1latest/rhel6/x86_64 >/dev/null 2>&1
find . -type f -name "*.rpm" -exec mv {} ${MIRRORPATH}/ \; >/dev/null 2>&1 && echo done || echo failed
 
#Update Mirror
echo -en "-> Updating Mirror\t\t\t"
cd ${MIRRORPATH}
createrepo . >/dev/null 2>&1 && echo done || echo failed
 
#Generating gpg signature
echo -en "-> Updating gpg signature\t\t"
cd ${MIRRORPATH}/repodata
test -f repomd.xml.asc && rm repomd.xml.asc >/dev/null 2>&1
echo 'passwd' | gpg --passphrase-fd 0 --passphrase passwd --detach-sign --armor repomd.xml >/dev/null 2>&1 && echo done || echo failed
 
echo -en "-> clean up\t\t\t\t"
rm -rf /tmp/packages.vmware.com >/dev/null 2>&1 && echo done || echo failed

Repos Quelle anlegen

Hier erfolgt die Konfiguration, das unten genannte File muss eventuell erstellt werden.

/etc/yum.repos.d/lekker.repo
[lekker]
name=Lekker Energie
baseurl=http://rhel-update.intern.local/rhel6/$basearch
enabled=1
gpgcheck=1

Lekker GPG importieren

rpm --import http://rhel-update.intern.local/keys/LEKKER-GPG.pub

Einrichtung pruefen

yum repolist

Network configuration

system-config-network-tui

Redhat update service

rhn_register --nox

yum

Import rpm key's

rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

Install Vmware tools

yum -y install vmware-open-vm-tools-nox

Update

yum update
linux/redhat.txt · Last modified: 2018/09/07 10:11 by michel.pelzer