Viewing YUM variables using python

Below python oneliner will show you YUM variables typically defined in /etc/yum.conf and used by YUM/RPM. Very cool.

$ python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'


Loaded plugins: langpacks, update-motd
{'arch': 'ia32e',
'awsdomain': '',
'awsregion': 'us-west-2',
'basearch': 'x86 …
more ...

Fix "Error: No group data available for configured repositories" in YUM

Sometimes on your RHEL-like system you may encounter the following error:

$ sudo yum grouplist
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
You can use up2date --register to register.
ULN support will be disabled.
Setting up Group Process
Error: No group data available for configured repositories

This …

more ...