Skip to content

Instantly share code, notes, and snippets.

@jasondgreene
Last active June 2, 2019 23:29
Show Gist options
  • Save jasondgreene/76cf0b46a51a1534b9e6f2886fccdf44 to your computer and use it in GitHub Desktop.
Save jasondgreene/76cf0b46a51a1534b9e6f2886fccdf44 to your computer and use it in GitHub Desktop.
Bash script to create .repo file for local Red Hat server rpms
#!/bin/bash
# Create client .repo file
cat >/etc/yum.repos.d/rh.repo <<EOF
[rh]
name=RedHatRepository
baseurl=http://<ip or host>/repos/rhel-7-server-rpms
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment