Skip to content

Instantly share code, notes, and snippets.

@ricfeatherstone
Created February 2, 2016 12:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricfeatherstone/9d7dd52c55fa639c8718 to your computer and use it in GitHub Desktop.
Save ricfeatherstone/9d7dd52c55fa639c8718 to your computer and use it in GitHub Desktop.
Enable rhel-server-extras repository in AWS
#!/usr/bin/python
from __future__ import print_function
import fileinput
in_start_extras_section = False
for line in fileinput.input("/etc/yum.repos.d/redhat-rhui.repo", inplace=True):
if line.find("[rhui-REGION-rhel-server-extras]") != -1:
in_start_extras_section = True
if in_start_extras_section:
if line.find("enabled=0") != -1:
print("enable=1")
in_start_extras_section = False
else:
print(line, end='')
else:
print(line, end='')
@ricfeatherstone
Copy link
Author

Better to create a new file in yum.repos.d with the content to enable the repo

cat<<EOF > /etc/yum.repos.d/redhat-rhui-rhel-server-extras.repo
[rhui-REGION-rhel-server-extras]
...
EOF

@ricfeatherstone
Copy link
Author

Or even better

sudo yum repolist disabled
sudo yum-config-manager --enable "Red Hat Enterprise Linux Server 7 Extra(RPMs)"

@RF-FaisalZ
Copy link

For me, the actual name was slightly different. Thanks for this hint 👍

yum-config-manager --enable "Red Hat Enterprise Linux 7 Server - Extras from RHUI (RPMs)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment