Bug 240326 - Cannot use yum as non-root
Summary: Cannot use yum as non-root
Status: CLOSED DUPLICATE of bug 222327
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: yum-rhn-plugin   
(Show other bugs)
Version: 5.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Clifford Perry
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2007-05-16 15:24 UTC by Jack Neely
Modified: 2007-12-10 20:02 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-12-10 18:43:50 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Jack Neely 2007-05-16 15:24:20 UTC
Description of problem:
Yum has several features and modes of operation for non-root users.  However, as
Yum can't read the RHN configuration as non-root all of these operations fail
regarding any RHN channels. 

For example:
$ yum list 'tomcat5*'
Loading "installonlyn" plugin
Loading "fedorakmod" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up repositories
Reading repository metadata in from local files

Using root or sudo and yum lists out the tomcat5 packages from RHN as would be

Version-Release number of selected component (if applicable):

Comment 1 wdc 2007-08-10 17:56:34 UTC
This is going to be disorienting to users at MIT.

People are used to up2date NOT complaining of no RHN registration when run as non-root.

Comment 2 Red Hat Bugzilla 2007-10-26 00:52:12 UTC
User jslagle@redhat.com's account has been closed

Comment 3 wdc 2007-12-03 19:14:33 UTC
Is there a status update on this problem?
A month has gone by.
Red Hat customers have been being bit by this problem.
Red Hat support has had to deal with customers being bit by this problem.

Is there a candidtate fix?

Is Red Hat content to look stupid for having dropped up2date and adopted yum?
Is this an easy thing to fix or a difficult thing to fix?
Has anyone even made that assessment yet?

Comment 4 Clifford Perry 2007-12-10 18:43:50 UTC
Hi there, 
This is being marked as a dupe of bug 222327. 

Within bug 222327 - we have committed code into the yum-rhn-plugin, which should
unload/remove the plugin if yum is being run as a non-root user. 

This is being tracked for inclusion (pending QA) into the Beta and then final
versions of the Red Hat Enterprise Linux 5 - update 2 release. 


bz#222327 if yum run as a non-root user notify the user RHN repo is not accessible

--- rhnplugin.py	2007-12-04 18:54:55 UTC (rev 134462)
+++ rhnplugin.py	2007-12-04 19:39:51 UTC (rev 134463)
@@ -51,6 +51,13 @@
     RHN_DISABLED = _("RHN support will be disabled.")
+    if not os.geteuid()==0:
+        # If non-root notify user RHN repo not accessible
+        conduit.error(0, _("*Note* Red Hat Network repositories are not listed
below. You must run this command as root to access RHN repositories.") + "\n" +
+        RHN_DISABLED)
+        rhn_enabled = False
+        return
     up2date_cfg = config.initUp2dateConfig()
         proxy_url = get_proxy_url(up2date_cfg)

*** This bug has been marked as a duplicate of 222327 ***

Comment 5 wdc 2007-12-10 20:02:50 UTC
Thank you very much for the information.  That is EXTREMELY helpful in understanding the root cause of 
the problem, and in knowing when to expect a remedy.

Note You need to log in before you can comment on or make changes to this bug.