Red Hat Bugzilla – Bug 600813
[RFE] capture complete list of yum repositories in sosreport
Last modified: 2016-07-03 21:33:30 EDT
Is it possible that in RHEL 6 in default sosreport we get complete list of repositories so we can see if customer is using some unofficial repository that could lead to braking of yum during updates. And bash history of root, so technical support can see commands that lead to error we are trying to fix.
Adam, what do you think? Seems reasonable to me.
Would the current approach upstream work for you? In installed-rpms, we get the output of: /bin/rpm -qa --qf="%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}~~%{INSTALLTIME:date}\t%{INSTALLTIME}\t%{VENDOR}\n" --nosignature --nodigest|/bin/awk -F ~~ '{printf \"%-60s%s\\n\",$1,$2}'|sort (this does not break checksysreport) We also have: if self.policy().rhelVersion() == 5: if len(os.listdir("/etc/yum.repos.d/")): self.addAlert("/etc/yum.repos.d/ contains additional repository "+ "information and can cause rpm conflicts.") I'd be happy to replace this with the inclusion of /etc/yum.repos.d/ to the sosreport.
Sorry, posted too fast. We already copy /etc/yum, /etc/yum.repos.d, /etc/yum.conf upstream. -- Pierre
Re-assigning as Adam's no longer working on SoS.
afaik the yum-rhn-plugin does not use files in /etc/yum.repos.d so I think we either need to run another command or look elsewhere for this data (although we do also need the /etc/yum* files to but afaik they are already being collected). I'll ask an rhn person to chime in here.
There is code in sos-2.2 to attempt to collect this output but it's not enabled by default and the option is broken: optionList = [("yumlist", "list repositories and packages", "slow", False)] optionList = [("yumdebug", "gather yum debugging data", "slow", False)] This attempts to add two options to the class but ends up redefining optionList (only yumdebug is added) so you get: # sosreport -k yum.yumlist=True sosreport (version 2.2) no such option "yumlist" for plugin (yum) Fix for this is trivial but still leaves the option disabled by default (it's marked "slow", False). With older yum versions I think this was valid but in my testing with RHEL/yum-rhn-plugin repos I think this is fast enough to enable by default. We can also pass yum --cacheonly to try to prevent updating cached metadata.
OK, I'll leave yumlist as an option to control collecting output of "yum list" as even with -C this is going to be slow on a machine with stale cache and move the repo listing to default.
# cat seg2-2011081212581313150309/sos_commands/yum/yum_-C_repolist Loaded plugins: auto-update-debuginfo, post-transaction-actions, rhnplugin Found 1 installed debuginfo package(s) Enabling epel-debuginfo: Extra Packages for Enterprise Linux 6 - x86_64 - Debug Reading repository metadata in from local files repo id repo name status epel Extra Packages for Enterprise Lin 6,237 epel-debuginfo Extra Packages for Enterprise Lin 1,359 rhel-x86_64-server-6 Red Hat Enterprise Linux Server ( 5,215 rhel-x86_64-server-6-debuginfo RHEL Server Debuginfo (v.6 for x8 2,222 rhel-x86_64-server-ha-6 RHEL Server High Availability (v. 93 rhel-x86_64-server-ha-6-debuginfo RHEL Server High Availability Deb 50 rhel-x86_64-server-optional-6 RHEL Server Optional (v. 6 64-bit 3,549 rhel-x86_64-server-optional-6-debuginfo RHEL Server Optional Debuginfo (v 1,334 rhel-x86_64-server-rs-6 RHEL Server Resilient Storage (v. 107 rhel-x86_64-server-rs-6-debuginfo RHEL Server Resilient Storage Deb 58 rhel-x86_64-server-sfs-6 RHEL Server Scalable File System 7 rhel-x86_64-server-sfs-6-debuginfo RHEL Server Scalable FS Debuginfo 3 repolist: 20,234
with -kyum.yumlist=True: # wc -l seg2-2011081213021313150530/sos_commands/yum/yum_list 18059 seg2-2011081213021313150530/sos_commands/yum/yum_list [root@seg2 tmp]# head seg2-2011081213021313150530/sos_commands/yum/yum_list; tail seg2-2011081213021313150530/sos_commands/yum/yum_list # head seg2-2011081213021313150530/sos_commands/yum/yum_list; tail seg2-2011081213021313150530/sos_commands/yum/yum_list Loaded plugins: auto-update-debuginfo, post-transaction-actions, rhnplugin Found 1 installed debuginfo package(s) Enabling epel-debuginfo: Extra Packages for Enterprise Linux 6 - x86_64 - Debug Reading repository metadata in from local files Installed Packages ConsoleKit.x86_64 0.4.1-3.el6 @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0 ConsoleKit-libs.x86_64 0.4.1-3.el6 @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0 GConf2.x86_64 2.28.0-6.el6 @rhel-x86_64-server-6 MAKEDEV.x86_64 3.24-6.el6 @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0 ORBit2.x86_64 2.14.17-3.1.el6 @rhel-x86_64-server-6 znc.x86_64 0.098-2.el6 epel znc-debuginfo.x86_64 0.098-2.el6 epel-debuginfo znc-devel.i686 0.098-2.el6 epel znc-devel.x86_64 0.098-2.el6 epel znc-extra.x86_64 0.098-2.el6 epel znc-modperl.x86_64 0.098-2.el6 epel znc-modtcl.x86_64 0.098-2.el6 epel zsh.x86_64 4.3.10-4.1.el6 rhel-x86_64-server-6 zsh-debuginfo.x86_64 4.3.10-4.1.el6 rhel-x86_64-server-6-debuginfo zsh-html.x86_64 4.3.10-4.1.el6 rhel-x86_64-server-optional-6
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2011-1536.html