United States (change)
Shortcuts: Downloads Fedora Red Hat Network
Account Links: Cart Your Account Logout
This article describes how to get the equivalent functionality of the --show-channels option that was available with up2date in Red Hat Enterprise Linux 4 and below using Red Hat Enterprise Linux 5's new package manager, yum.
The following Python script will show a list of the Red Hat Network (RHN) channels a particular system is currently subscribed to:
#!/usr/bin/python
import sys
import yum
myyum = yum.YumBase()
myyum.doConfigSetup(debuglevel=0)
repoCount = 0
for repo in myyum.repos.listEnabled():
print repo.id
repoCount = repoCount + 1
if (0 == repoCount):
sys.exit(1)
sys.exit(0)
For this script to work, the system must be properly registered to Red Hat Network (RHN), and the yum-plugin-rhn package must be installed.